SelectedItem listbox
У меня есть listbox, который содержит grid, внутри которого есть кнопки и текстовые поля. SelectedItem срабатывает только при нажатии на определенное текстовое поле. Как я могу сделать так, чтобы оно срабатывало при нажатии на кнопку и как я могу потом передать выбранный элемент в другую ViewModel в рамках MVVM?
<ListBox Background="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderThickness="0" RenderTransformOrigin="0.5,0.5" SelectedItem="{Binding SelectedArticle}" ItemsSource="{Binding Articles_list}" Grid.Row="3" VerticalAlignment="Top" Height="348" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="771" >
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="739" Height="520" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="151" Height="221" Margin="50 30 30 20">
<Image Opacity="0.7" Source="{Binding Url}" Margin="-1,0,0,142"/>
<Border BorderBrush="White" BorderThickness="1" Margin="0,-2,-1,1" HorizontalAlignment="Left" Width="152">
<Canvas Margin="0.2,133.2,-0.2,0.4">
<Button FontSize="10" BorderThickness="0 0 0 1" BorderBrush="White" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Height="20" Width="99" Canvas.Left="33" Canvas.Top="14">
<TextBlock Style="{StaticResource ThirdFont}" Text="{Binding Category}" FontSize="13" FontWeight="Bold" Foreground="White" Height="22" Width="43"/>
</Button>
<TextBlock TextWrapping="Wrap" Style="{StaticResource ThirdFont}" Text="{Binding Name}" FontSize="10" Foreground="White" RenderTransformOrigin="0.5,0.5" Height="16" Canvas.Left="32" Canvas.Top="41" Width="95"/>
<Button FontSize="10" BorderThickness="1" BorderBrush="White" Foreground="White" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Content="Read" Height="20" Width="66" Canvas.Left="48" Canvas.Top="61"/>
</Canvas>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
ViewModel
public NewArticles SelectedArticle
{
get {
return selectedArticle; }
set
{
selectedArticle = value;
OnPropertyChanged("SelectedArticle");
}
}