[Unity] TextBlock vs Label Binding
Hi,
I have a quick question:
Why does this work:
and this does not? (no error but nothing is displayed)
I have a quick question:
Why does this work:
Code: Select all
<TextBlock Text="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type Grid}}}" />
Code: Select all
<Label Content="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type Grid}}}" />
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: [Unity] TextBlock vs Label Binding
It seems we have a problem on how ContentPresenter (from the Label template) converts the Content when it is not a String or a UIElement. We will fix it for a following release.
The TextBlock is working because the default Converter created by the binding correctly converts from float to string.
The TextBlock is working because the default Converter created by the binding correctly converts from float to string.
Re: [Unity] TextBlock vs Label Binding
Thanks! I will try using TextBlock wherever possible for the time beeing.
Who is online
Users browsing this forum: No registered users and 3 guests