Bad XAML template generated from Blend

I used Blend to generate a XAML template for a combobox that was embedded inside of a toolbar. In a few places “{Binding (0)}” code was generated which is syntactically incorrect. I would like to fix this code but not sure what it should be binding to. Anyone else ever deal with this issue?

 <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding (0)}" Value="false"/> <Condition Binding="{Binding (0)}" Value="true"/> <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/> </MultiDataTrigger.Conditions> <Setter Property="Fill" TargetName="ArrowDownPath" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> <Setter Property="BorderBrush" TargetName="Chrome" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> </MultiDataTrigger> ... <Style.Triggers> <DataTrigger Binding="{Binding (0)}" Value="false"> <Setter Property="AutomationProperties.Name" Value="{Binding (AutomationProperties.Name), Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}"/> <Setter Property="AutomationProperties.LabeledBy" Value="{Binding (AutomationProperties.LabeledBy), Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}"/> <Setter Property="AutomationProperties.HelpText" Value="{Binding (AutomationProperties.HelpText), Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}"/> </DataTrigger> </Style.Triggers> ... 

submitted by /u/edwwsw
[link] [comments]

Leave a Reply