How to expand / collapse WPF Expander in code? I need to do this to initialize the control in it.
Use the IsExpanded property, set it to true to display the content:
IsExpanded
myExpander.IsExpanded = true;
Set it to false to collapse the expander.
You can simply set the IsExpanded property, but I prefer to use VisualStateManager and make such user interface changes using VisualStateManager.GoToState .
VisualStateManager
VisualStateManager.GoToState
Source: https://habr.com/ru/post/906184/More articles:Cleaning up a task and starting a new action - androidandroid How to switch between intentions - androidCreating a JAR file that contains other library files - javaJava Packaging / Building Common Techniques Jar File Specific - javaAndroid TTS Male Female Voice Change - androidCreate faded corners / sides of UIImage (not animation) - iphoneFriends list of a friend using Twitter4J - javaAnt - how to get the name of all files in a specific folder - antStrange issue in vim, code not updating - vimWhy is the type of the ref parameter different from the regular type? - reflectionAll Articles