I have a quick question regarding visibility of windows in an application. According to... http://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx (its short)
When a window is collapsed no space is reserved for the window in layout. When a window is hidden space is reserved for the window in layout.
I'm confused here, what is the layout referring to? Is it referring to window space?
Here's an illustration:
<Grid>
<TabControl>
<TabItem Header="Visible"></TabItem>
<TabItem Visibility="Hidden" Header="Hidden">Hidden</TabItem>
<TabItem Visibility="Hidden" Header="Hidden">Hidden</TabItem>
<TabItem Visibility="Hidden" Header="Hidden">Hidden</TabItem>
<TabItem Header="Visible"></TabItem>
<TabItem Header="Visible"></TabItem>
<TabItem Header="Visible"></TabItem>
</TabControl>
</Grid>
Will render this:
And this XAML:
<Grid>
<TabControl>
<TabItem Header="Visible"></TabItem>
<TabItem Visibility="Collapsed" Header="Collapsed">Collapsed</TabItem>
<TabItem Visibility="Collapsed" Header="Collapsed">Collapsed</TabItem>
<TabItem Visibility="Collapsed" Header="Collapsed">Collapsed</TabItem>
<TabItem Header="Visible"></TabItem>
<TabItem Header="Visible"></TabItem>
<TabItem Header="Visible"></TabItem>
</TabControl>
</Grid>
Will render this:
So, Collapsed
will not save the space, whereas Hidden
will.
No, its referring to the whole window you are looking at.
Lets say, you have at the top of the screen a Red Block (20px height) and below the Red Block you have a title.
Hidden: The Red Block is NOT visible, but the space it normally reserves, is still reserved, meaning the Title is is 20px away from the top of the screen
Collapsed: The Red Block is NOT visible together with the reserved space (the 20px height), meaning the Title is located at the top of the screen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With