How to expand/collapse a WPF Expander in code? I need to do it in order to initialize a control in it.
Use the IsExpanded
property, set it to true for making the content visible:
myExpander.IsExpanded = true;
Set it to false to collapse the expander.