Binding to ActualWidth
See original GitHub issueQuick question: Is binding to ActualWidth
supported?
<StackPanel>
<Grid ColumnDefinitions="300">
<Button Name="Test" Content="Hello"></Button>
</Grid>
<Button Content="World" Width="{Binding #Test.ActualWidth}"></Button>
</StackPanel>
The second button should have a width of 300 now, but it’s NaN
instead. What am I missing out?
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
How to bind to a control's literal actual width (including its ...
There is no way of doing this through binding because the ActualWidth property doesn't include the margin as already stated.
Read more >Binding to ActualWidth property returns 0 at runtime - Forums
Hello, I am working on a top bar that displays currencies. It should stretch its inner part based on text width, so I...
Read more >FrameworkElement.ActualWidth Property - UWP
For purposes of ElementName binding, ActualWidth does not post updates when it changes (due to its asynchronous and run-time calculated nature).
Read more >Adding support for bindable ActualHeight/ActualWidth of ...
I read somewhere that binding to ActualHeight is not a good idea because it can cause issues with UpdateLayout mechanisms not knowing when...
Read more >Simple Behavior for Binding to ActualWidth or ActualHeight
to mitigate the problem I created a simple Behavior that enables binding to another element ActualHeight and ActualWidth.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use Bounds.Width instead.
Ah, I didn’t notice that one. Ok, I will close this and assign myself to that issue, hope that’s ok. Will fix asap.