I have a ListView & each List Item in it is a Button containing an Image. Upon clicking a Button I am trying to navigate to another page (say., page2.xaml) I am using MVVM light framework.
Here's my XAML:
<ListView Grid.Row="1" Grid.ColumnSpan="2"
Visibility="Visible"
ItemsSource="{Binding buttonLists}" >
<ListView.ItemTemplate>
<DataTemplate>
<Button Style="{StaticResource ImageButton}" Command="{Binding GoToCommand}">
<Grid Style="{StaticResource GridItem}" Background="Blue">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="{Binding imageSource}"></Image>
</Grid>
</Button>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
In my ViewModel, inside the class I gave,
public ICommand GoToCommand
{
get
{
return new RelayCommand(GoToCommand);
}
}
private readonly INavigationService gotoNavigationService;
private void GoToCommand()
{
}
What navigation command should be given inside GoToCommand()? I am not much familiar with RelayCommand. Thanks.