Last active
November 20, 2015 15:57
-
-
Save asimmon/cb80fe2ce83caf65aaae to your computer and use it in GitHub Desktop.
EventToCommand Xamarin Forms - Example View
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:b="clr-namespace:HelloEventToCommand.Behaviors;assembly=HelloEventToCommand" xmlns:c="clr-namespace:HelloEventToCommand.Converters;assembly=HelloEventToCommand" x:Class="HelloEventToCommand.Views.HomeView"> | |
<ContentPage.Resources> | |
<ResourceDictionary> | |
<c:ItemTappedEventArgsConverter x:Key="ItemTappedConverter" /> | |
</ResourceDictionary> | |
</ContentPage.Resources> | |
<ListView ItemsSource="{Binding People}"> | |
<ListView.Behaviors> | |
<b:EventToCommandBehavior EventName="ItemTapped" Command="{Binding SayHelloCommand}" EventArgsConverter="{StaticResource ItemTappedConverter}" /> | |
</ListView.Behaviors> | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<TextCell Text="{Binding Name}"/> | |
</DataTemplate> | |
</ListView.ItemTemplate> | |
</ListView> | |
</ContentPage> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment