I couldn't find an appropriate topic for my problem. I have the following code.
<ContentPresenter x:Name="ContentPresenter"
VerticalAlignment="Center"
Width="Auto"/>
<TextBox x:Name="TextBlockFront" >
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ElementName=TextBlockFront, Path=IsFocused}" Value="true"/>
<Condition Binding="{Binding ElementName=ContentPresenter, Path=ContentProperty}" Value="ComboBox"/>
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Hidden"/>
<Setter Property="Text" Value="{Binding ElementName=ContentPresenter,Path=SelectedItem}"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
I want to get the clarification about the second condition of my MultiTrigger. I am relative new to WPF and I would appreciate any help in sorting out my doubt.
Expected behaviour:
when the TextBox is focused AND the ContentPresenter is ComboBox then I want to set the above properties. If the ContentPresenter is TextBox then I will set the Text property instead of SelectedItem