ListViewBaseExtensions class

ListViewBaseExtensions provides extension method that allow attaching ICommand to handle ListViewBase Item interaction by means of ItemClick event. ListViewBase IsItemClickEnabled must be set to true

Example

    // Attach the command declared in MainViewModel to ListView declared in XAML
    // IsItemClickEnabled is set to true as shown below
    <ListView
        ui:ListViewBaseExtensions.Command="{x:Bind MainViewModel.ItemSelectedCommand, Mode=OneWay}"
        IsItemClickEnabled="True"
        ItemsSource="{x:Bind MainViewModel.Items, Mode=OneWay}"
        SelectionMode="None" />

Requirements (Windows 10 Device Family)

Device family Universal, 10.0.10586.0 or higher
Namespace Microsoft.Toolkit.Uwp.UI

API