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


    // Attach the command declared in MainViewModel to ListView declared in XAML
    // IsItemClickEnabled is set to true as shown below
        ui:ListViewBaseExtensions.Command="{x:Bind MainViewModel.ItemSelectedCommand, Mode=OneWay}"
        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