How to access data from another datatemplate in wpf ?
    <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>
<Button.CommandParameter>
<Binding ElementName="SourceDataGrid" Path="SelectedItem"></Binding>
</Button.CommandParameter> 
</Button>
<StackPanel>
</DataTemplate>
How to access data from another datatemplate in wpf ?
===

    <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>
<Button.CommandParameter>
<Binding ElementName="SourceDataGrid" Path="SelectedItem"></Binding>
</Button.CommandParameter> 
</Button>
<StackPanel>
</DataTemplate>