I have 3 datagrids: grid0, gird1, grid2 binded to observable collection Watches0, Watches1, Watches2 respectively. Here is just small example, in my real project DataGrids had many columns with styles, converters etc. All datagrids are completely same except x:Name, Grid.Column and ItemSource properties. The problem is if I want to change some property or column in xaml I have to do it for all 3 datagrids. I was thinking about using styles or templates but see some problems with it. I'm interested is there a way to "copy" element in xaml?
<DataGrid x:Name="grid0"
Grid.Column="0"
AllowDrop="True"
AutoGenerateColumns="False"
SelectionMode="Extended"
ItemsSource="{Binding Watches0}"
Drop="watchesGrid_Drop"
PreviewMouseLeftButtonDown="watchesGrid_PreviewMouseLeftButtonDown">
<DataGrid.Columns>
<DataGridTextColumn Header="Name"
Binding="{Binding Name}"
Width="40" />
<DataGridTextColumn Header="Value"
IsReadOnly="True"
Binding="{Binding Value}"
Width="60" />
</DataGrid.Columns>
</DataGrid>