SlidableListItem - nmetulev/comet GitHub Wiki
#SlidableListItem
A UI control that enables actions to be triggered by sliding the content left or right. In most cases, it will be used as a ListView DataTemplate root, but it is not required.
##Syntax
<DataTemplate x:Key="EmailsItemTemplate" x:DataType="data:Item">
<c:SlidableListItem LeftIcon="Favorite"
RightIcon="Delete"
LeftLabel="Set Favourite"
RightLabel="Delete"
HorizontalAlignment="Stretch"
LeftBackground="Green"
RightBackground="Red"
MouseSlidingEnabled="true"
LeftCommand="{x:Bind ToggleFavorite}"
RightCommandRequested="RightCommandRequested">
<Grid Height="110">
<StackPanel Margin="10,0,0,0">
<CheckBox IsChecked="{x:Bind IsFavorite, Mode=OneWay}"/>
<TextBlock Text="{x:Bind Title}"
TextWrapping="NoWrap"/>
</StackPanel>
</Grid>
</c:SlidableListItem>
</DataTemplate>
Event | Description |
---|---|
LeftCommandRequested | Occurs when the user swipes to the right to activate the left action |
RightCommandRequested | Occurs when the user swipes to the left to activate the right action |
Property (type) | Description |
---|---|
ActivationWidth (double) | Gets or sets the amount of pixels the content needs to be swiped for an action to be requested |
LeftIcon (Symbol) | Gets or sets the left icon symbol |
RightIcon (Symbol) | Gets or sets the right icon symbol |
LeftLabel (string) | Gets or sets the left label |
RightLabel (string) | Gets or sets the right label |
LeftForeground (Brush) | Gets or sets the left foreground color |
RightForeground (Brush) | Gets or sets the right foreground color |
LeftBackground (Brush) | Gets or sets the left background color |
RightBackground (Brush) | Gets or sets the right background color |
MouseSlidingEnabled (bool) | Gets or sets the ability to slide the control with the mouse. False by default |
LeftCommand (ICommand) | Gets or sets the ICommand for left command request |
RightCommand (ICommand) | Gets or sets the ICommand for right command request |