Skip to content

Commit

Permalink
Add one-way binding for Label's Foreground property
Browse files Browse the repository at this point in the history
Introduced a new binding for the Foreground property of the TextBlock named Label. This binding connects the Foreground property to LabelForeground in the data context, ensuring that changes to LabelForeground are reflected in the TextBlock's foreground color. The binding mode is set to one-way.

Signed-off-by: Christoph Hofmann <[email protected]>
  • Loading branch information
hoffe86 committed Jan 19, 2025
1 parent 94bddf4 commit b4ac5f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/openHAB.Windows/Controls/ImageLabel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Stretch="Uniform" />
<TextBlock x:Name="Label"
Margin="8"
Foreground="{x:Bind LabelForeground, Mode=OneWay}"
Text="{x:Bind LabelText, Mode=OneWay}"
TextTrimming="WordEllipsis" />
</StackPanel>
Expand Down

0 comments on commit b4ac5f8

Please sign in to comment.