Resize content in a dockpanel

Is it possible to resize all children content, ie., a MediaElement, when the size of it's parent DockPanel changes?

Thanks!

[138 byte] By [Dvlnblk] at [2008-1-4]
# 1
What do you mean by resize? A dockpanel would do some amount of resizing the children to fit -- based on the settings of individual elements (like are they set to Auto heights and widths or specific H & Ws). If the property LastChildFill is set, then the last element to be added as a child is automatically stretched to fill the remaining space.

If you want to scale a UI, you might look at a ViewBox.

WPCoder at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2
Thanks for the help. My question is: How to I set the height and width to auto in C#?
Dvlnblk at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
someObject.SetValue(someObjectClass.WidthProperty, "Auto"); should work

The reason you can't use someWPFObject.Width is because I believe it is actually the value converter that handles the special case of Auto.

NathanNeitzke at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 4

When I try this:

vc_clone.SetValue(DockPanel.HeightProperty , "Auto");

I get this error:

{"'Auto' is not a valid value for property 'Height'."}

What am I doing wrong? Thanks for the help.

Dvlnblk at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 5
in code:
vc_clone.SetValue(DockPanel.HeightProperty, Double.NaN)
WPCoder at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified