全部博文(105)
分类: 嵌入式
2012-04-14 12:33:43
3. Visibility Property
Before i started learning the wonders of , i worked with WinForms. With WinForms, life was simple, a Form or Component was either Visible = true or Visible = false. Along comes stomping all over WinForms and worst of all forcing its three states of visibility on us!
After i found out what that third state was, i was willing to forgive because its pretty handy. the third state is:
usrAddBtn.Visibility = System.Windows.Visibility.Collapsed;
Collapsed makes the Element not only invisible but doesn’t reserve the space within the Parent Element. What does this mean in the real world? well it means that you could collapse a Panel and place a new Panel in its placed. This means that instead of creating new Windows for settings pages for example, you can reuse the space of your main Window.