我是wpf的初學者,我想幫助您製作這段XAML代碼。「Cascade」Databinding
<DataGrid ItemsSource="{Binding Elements[person]}" >
<DataGrid.Columns>
<DataGridTextColumn x:Name="headerPhone" Binding="{Binding Element[phone].Value}">
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" x:Name="headerPhoneCStyle">
<Style.Triggers>
<DataTrigger Binding="{Binding Element[phone].Attribute[changed].Value}" Value="yes">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
有一些方法如何減少這樣的:
Binding="{Binding Element[phone].Attribute[changed].Value}"
要只是這樣的事情:
Binding="{Binding Attribute[changed].Value}"
'Binding =「{Binding Attribute [changed] .Value}」'這是行不通的? – Sankarann