Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,696 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have two textboxes where user enters prefix and suffix to be appended in already existing itemscontrol of checkboxes. I want the functionality if the name already exists s.t. prefixText+any item+ suffixText then make the existing item red and bold.
Attached file has XAML and ViewModel. (Do I need MultiBinding?)
Edit: attached text file
Many thanks,
Harry
Hi Harry,
check value of DataTrigger to "True" and return true/fasle from Converter.
<DataTrigger Value="True">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource conv}">
<Binding RelativeSource="{RelativeSource Self}" Path="Content"/>
<Binding Path="Text" ElementName="prefixTB"/>
<Binding Path="Text" ElementName="suffixTB"/>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Foreground" Value="Red"/>
<Setter Property="FontWeight" Value="DemiBold"/>
</DataTrigger>
Converter:
Or shorter: