Replies: 2 comments 2 replies
-
The typical way of doing these things without modifying source is to write an attached behavior (or attached property). ie. Listen for Otherwise, you can do something like: <Label IsEnabled="{Binding #edt.IsEnabled}" Content="_A Edit" Target="{Binding #edt}" />
<TextBox IsEnabled="False" x:Name="edt" /> |
Beta Was this translation helpful? Give feedback.
-
If you notice, there is a binding error because Changing it to Anyway, this alternative is much simpler and should work in your case: <Setter Property="IsEnabled">
<Binding Path="$self.Target.IsEnabled" FallbackValue="False" />
</Setter> |
Beta Was this translation helpful? Give feedback.
-
Im trying to make
Label
to auto disable in this situations:I use next setter in Label ControlTheme:
I expect what IsEnabled will be TRUE only if target is set (non-null) and trget enabled.
This is working partially: If Target is set to existing control which is disabled - Label is disabled, but if Target is not set at all or is set to non-existing name, Label still enabled.
looks like:
What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions