I am trying to reuse the XAML that I am writing as much as possible.
Now, I would like to display my objects in DataGrids. My objects share some common properties through heritage. Therefore I would like to create a UserControl with a grid and among others define some columns for the properties that are common to each objects. So something looking like that:
<UserControl Name="MyCustomGrid">
<Grid>
<DataGrid>
<!-- Common Settings -->
...
<!-- /Common Settings -->
<DataGrid.Columns>
<ADataGridColumn Name="CommonProperty1"/>
<ADataGridColumn Name="CommonProperty2"/>
...
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
Then I would like to be able to use this UserControl and add extra columns for the specific properties of the objects I want to display, through XAML like so:
<view:myCustomGrid>
<view:myCustomGrid.Columns>
<ADataGridColumn Name="SpecificProperty1"/>
<ADataGridColumn Name="SpecificProperty2"/>
...
</view:myCustomGrid.Columns>
</view:myCustomGrid>
Is this possible ? I have looked at this question but it doesn't seem like I can insert an ContentControl under DataGrid.Columns
Maybe this is not the way to go...
Thanks for your help