I want to add a clickable event where it goes to specific query action
Example: I have this 3 list Image
how to add an action when I click one of that list and it goes to id that i selected and doing something
Mydb Example Database
Query
select * from library where id_movie = (the one that i clicked)
Xaml
<ItemsControl ItemsSource="{Binding Path=Library}" Margin="0,0,2,0">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="viewModels:Card">
<UniformGrid Rows="1" Columns="1">
<StackPanel Orientation="Horizontal" Width="100" Height="150" Margin="10,25,0,0" >
<Image Width="100" Source="{Binding Path=cover}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10,0,0,0">
<Label Content="{Binding Path=title}"/>
</StackPanel>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
MyClass
public class VModel
{
public VModel()
{
DataTable dt = new DataTable();
DataSet ds = new DataSet();
using (MySqlConnection connection = new MySqlConnection("SERVER=localhost;" + "DATABASE=library;" + "UID=root;" + "PASSWORD=;"))
{
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = new MySqlCommand("Select * from movie_list", connection);
adapter.Fill(dt);
}
Library = dt.DefaultView;
}
public DataView Library { get; private set; }
}