<Grid> <DataGrid Name="DataGrid01"> <DataGrid.Columns> <DataGridTemplateColumn Header="Shape1"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Rectangle x:Name="Rectangle01" Fill="Blue" Width="20" Height="20"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid> <DataGrid Name="DataGrid02"> <DataGrid.Columns> <DataGridTemplateColumn Header="Shape2"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Rectangle x:Name="Rectangle02" Fill="{Binding Path=Fill, ElementName=Rectangle01}" Width="20" Height="{Binding Path=RenderSize.Height, ElementName=Rectangle01}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid> </Grid>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)