Extending / Collapsing a WPF Extender

How to expand / collapse WPF Expander in code? I need to do this to initialize the control in it.

+6
source share
2 answers

Use the IsExpanded property, set it to true to display the content:

 myExpander.IsExpanded = true; 

Set it to false to collapse the expander.

+17
source

You can simply set the IsExpanded property, but I prefer to use VisualStateManager and make such user interface changes using VisualStateManager.GoToState .

0
source

Source: https://habr.com/ru/post/906184/


All Articles