I have something similar to this and i want to change the binding for different instances.
In this example I would like to change the binding for myname to another (say hisname) in the second instance. Is this possible?
<Window.Resources>
<DataTemplate x:Key="MyGridContentTemplate">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="Your name is:"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0"
FontWeight="Bold"
Text="{Binding MyName}"/>
<TextBlock Grid.Row="1" Text="Your address is:"/>
<TextBlock Grid.Row="1" Grid.Column="1" Margin="8,0,0,0"
FontWeight="Bold"
Text="{Binding Address}"/>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" ContentTemplate="{StaticResource MyGridContentTemplate}" Content="{Binding}"/>
<Separator Grid.Row="1"/>
<ContentPresenter Grid.Row="2" ContentTemplate="{StaticResource MyGridContentTemplate}" Content="{Binding}"/>
</Grid>
Any help appreciated