WPF is a great toolkit and XAML data binding is very efficient, but I often run into difficulties with its transparency: it can be difficult to debug data binding failure if errors are not thrown.
For example, I recently had to modify a Style declaration as follows:
<DataGrid.RowStyle> <Style> <Style.Triggers> <DataTrigger Binding="{Binding TestProperty}" Value="False"> <Setter Property="DataGridRow.Background" Value="Red"/> </DataTrigger> </Style.Triggers> </Style> </DataGrid.RowStyle>
In it:
<DataGrid.RowStyle> <Style> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.TestProperty}" Value="False"> <Setter Property="DataGridRow.Background" Value="Red"/> </DataTrigger> </Style.Triggers> </Style> </DataGrid.RowStyle>
To affect the DataGridRow property. It would be incredibly useful to see, during design or runtime, what consequences might be associated with different sources and RelativeSource .
Are there any such tools / methods?
Dan j
source share