Hi,
I have 2 Datatemplates. One contain a grid , second one contain a button. I need to send command parameters of button as selected grid items.
How can i do this ?
<ObjectDataProvider x:Key="Datas" ObjectType="{x:Type ViewModel:UserControlViewModel}"></ObjectDataProvider>
<DataTemplate x:Key="SourceGrid">
<WPFToolKit:DataGrid x:Name="SourceDataGrid" ItemsSource="{Binding Source={StaticResource Datas},Path=SourceGridData}" CanUserSortColumns="True" GridLinesVisibility="None" IsSynchronizedWithCurrentItem="True" SelectionUnit="FullRow"></WPFToolKit:DataGrid>
</DataTemplate>
<DataTemplate x:Key="AddRemoveDataTemplate">
<StackPanel>
<Button Name="Add" Content="Add">
<Button.Command>
<Binding Source="{StaticResource Datas}" Path="AddCommand">
</Binding>
</Button.Command>
<Binding ElementName="SourceDataGrid" Path="SelectedItem"></Binding>
</Button.CommandParameter>
</Button>
<StackPanel>
</DataTemplate>