ActualWidth is set by the rendering system, and may be different depending on the widths of other elements and overall size constraints. As a result, it can not be changed.
Questions tagged [actualwidth]
91 questions
4
votes
2 answers
Setting Margin, Width bound to ActualWidth on Controls causes VS2012 Crash
I was messing around with DataGrid headers and discovered something awkward. I toyed with it until I found the root cause in the XAML and built a small sample of how to reproduce.
I only tested this with textbox and datagrid, but I suspect it works…

jamesSampica
- 12,230
- 3
- 63
- 85
4
votes
1 answer
Finding ActualWidth of a User Control
I'm working on some layout stuff with XAML/C# and for certain reasons I am unable to use the SizeToContent="Width" option however I would like to simulate it in certain situations. I have a user control sitting inside of an expander and I would like…

Jesse Carter
- 20,062
- 7
- 64
- 101
4
votes
3 answers
Binding to ColumnDefinition.ActualWidth returns 0
Paste this into Cider.

CannibalSmith
- 4,742
- 10
- 44
- 52
3
votes
3 answers
How can I get the size of an autosized WPF Window?
I have a Window that is autosized around it's content. For an animation I'd need it's width and height. ActualWidth is always the max width of the window, Width and Height properties say NaN.

laci37
- 510
- 4
- 17
3
votes
2 answers
Silverlight - Binding Listbox ActualWidth to ListboxItem Width
I'm working on a photo gallery for Windows Phone 7 and I'm trying to get each image to take the full screen and slide horizontally.
What I am doing so far is to use a listbox that I have modified to scroll horizontally but the problem is that I…

Fallafab
- 31
- 2
3
votes
4 answers
WPF - Image Control Actual Size
I have a problem in getting ActualHeight and ActualWidth of image control in WPF. When user selects the image file, I want to resize the selected image based on the dimensions of the image control.
I tried to get the Image.ActualHeight and…

Harsha
- 1,861
- 7
- 28
- 56
3
votes
2 answers
WPF UserControl expose ActualWidth
How do I expose the ActualWidth property of one of the components of my user control to users?
I have found plenty of examples of how to expose a normal property by creating a new dependency property and binding, but none on how to expose a…

MJS
- 155
- 3
- 9
3
votes
2 answers
ColumnDefinition doesn't expand until resize
I have a grid where one columnwidth is defined as *.
The other columns are defined as Auto.
The column with the *-definition contains a usercontrol derived from Panel that also implements IScrollInfo.
During this control's MeasureOverride visibility…

risingape
- 31
- 2
3
votes
1 answer
How to calculate ActualWidth ActualHeight before window showing
I'm trying to calculate StackPanel width, height (located in middle cell of the grid) before window showing (for example in window constructor). How it can be achieved?

user1897059
- 183
- 2
- 7
3
votes
1 answer
ActualHeight and ActualWidth of object is always zero
I have a Canvas with a TextBlock like so:
3
votes
3 answers
WPF - Binding and RenderTransform
I would like to bind a scaleTransform to a converter passing the ActualWidth or ActualHeight.
Here what I want to do :
2
votes
1 answer
ActualHeight / ActualWidth
I'm a little confused with how ActualWidth or ActualHeight works or how it gets calculated.
…

Michael
- 2,088
- 6
- 29
- 47
2
votes
1 answer
Binding issue ActualWidth on dynamic filled Grid
Consider the following, simple code:
XAML:
…

321X
- 3,153
- 2
- 30
- 42
2
votes
1 answer
Overriding ActualWidth and ActualHeight dependency properties
I have a custom line shape with start and end point. The ActualWidth and ActualHeight properties however do not return the correct value, that is the difference between the points. Is there a way to override these properties in the derived class,…

mihajlv
- 2,275
- 4
- 36
- 59
2
votes
1 answer
Silverlight Get actual width of Grid that is set as Auto
Say I have a Grid whose Width is set as Auto. Inside this grid I want to put a new grid that is a square. To do this I want the new grid's width and height to be equal. I thought I could just set the Width and Height to the Parent Grid's Width. The…

cmptrer
- 1,419
- 4
- 13
- 25