Я использую FlowListView и выглядит великолепно и потрясающе! Но у меня есть некоторые проблемы, чтобы заставить его работать с событиями onclick.
Это мой Xaml:
<?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:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView"
x:Class="EscapeHaarlem.Views.ItemsPage"
Title="{Binding Title}"
x:Name="BrowseItemsPage">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="46*"/>
<RowDefinition Height="38*"/>
</Grid.RowDefinitions>
<StackLayout Padding="10">
<flv:FlowListView Grid.Row="0" FlowColumnCount="2"
SeparatorVisibility="Default"
HasUnevenRows="True"
FlowItemTapped="FlowListView_FlowItemTapped"
FlowItemTappedCommand="{Binding ItemTappedCommand}"
FlowItemsSource="{Binding Items}">
<flv:FlowListView.FlowColumnTemplate>
<DataTemplate>
<Frame BackgroundColor="ForestGreen" Margin="5">
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
TextColor="White"
XAlign="Center"
YAlign="Center"
Text="{Binding Text}"/>
</Frame>
</DataTemplate>
</flv:FlowListView.FlowColumnTemplate>
</flv:FlowListView>
<StackLayout>
<Button Grid.Row="1" Text="Emergeny" BackgroundColor="DarkRed"></Button>
</StackLayout>
</StackLayout>
</Grid>
</ContentPage.Content>
Где я думал, что FlowItemTapped="FlowListView_FlowItemTapped"
использовался для событие onclick.
Но когда я использую следующую функцию для события клика, оно не сработает:
async void FlowListView_FlowItemTapped(object sender, SelectedItemChangedEventArgs args)
{
var item = args.SelectedItem as Item;
if (item == null)
return;
bool answer = await DisplayAlert("Question?", "Would you like to play a game", "Yes", "No");
if (answer == true)
{
await Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));
}
else
{
return;
}
// Manually deselect item.
//ItemsListView.SelectedItem = null;
}
Как сделать эти элементы кликабельными?
Это макет для xaml, который вы видите

Заранее спасибо