tags:

views:

200

answers:

2

We have a WPF executable that creates a and then dynamically loads several assemblies. Each assembly represents a screen (.xaml) that is displayed in one of the tabs. The Problem is that the is right under the and not at the bottom of the window. How do I force the to always be at the bottom of the window? Thx!

UserControl    
    DockPanel
        CheckBox 
        StatusBar
    DockPanel
UserControl
+1  A: 

Did you try?

<StatusBar DockPanel.Dock="Bottom" ... />
ArsenMkrt
+5  A: 

In addition to ArsenMkrt's answer about including the DockPanel.Dock="Bottom" attribute, don't forget that the LAST element in a DockPanel will fill the area unless you explicitly tell it otherwise using a height command (regardless of the DockPanel.Dock attribute provided).

my suggestion is to do thus:

<UserControl>
   <DockPanel>
     <StatusBar DockPanel.Dock="Bottom" />
     <CheckBox />
   </DockPanel>
</Usercontrol>
Stephen Wrighton
re: your comment on the last element, you can also set the LastChildFill property on DockPanel
qntmfred
@qntmfred - you're right. I forget about that attribute, mainly due to the fact that I usually want the last child to fill.
Stephen Wrighton