Created
April 21, 2017 18:01
-
-
Save ChaseFlorell/2eaa7cb2865327e3e4cf730b165b76c9 to your computer and use it in GitHub Desktop.
my idea of a xamarin forms listview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListView SeparatorWidth="2" | |
PullToRefreshCommand="{Binding Fetch}" | |
ItemTappedCommand="{Binding Navigate}"> | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<ViewCell> | |
<ViewCell.ItemStyles> | |
<ViewCellItemStyle State="Normal" BackgroundColor="White" SeparatorColor="Red" /> | |
<ViewCellItemStyle State="Pressed" BackgroundColor="Grey" SeparatorColor="Blue" /> | |
<ViewCellItemStyle State="LongPressed" BackgroundColor="Green" SeparatorColor="Pink" /> | |
<ViewCellItemStyle State="Selected" BackgroundColor="Yellow" SeparatorColor="Brown" /> | |
</ViewCell.ItemStyles> | |
<ViewCell.ContextActions> | |
<MenuItem Icon="delete" Text="Delete" IsDestructive="True" Order="Primary" Command="{Binding Foo}" /> | |
<MenuItem Icon="archive" Text="Archive" IsDestructive="False" Order="Secondary" Command="{Binding Bar}" /> | |
</ViewCell.ContextActions> | |
<ViewCell.View> | |
<StackLayout> | |
<Label Text="Hello World" /> | |
</StackLayout> | |
</ViewCell.View> | |
</ViewCell> | |
</DataTemplate> | |
</ListView.ItemTemplate> | |
</ListView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes
State
on theViewCellItemStyle
will be an enumOrder
on theMenuItem
will be the left/right selector for iOS, and be the default primary/secondary for android (as it is now forToolbarItem