You can add the IsExpanded property to your ViewModel, associate an expander with it, and accept the value of this property when you return the contents of the ContentControl :
private bool _isExpanded; public bool IsExpanded { get { return _isExpanded; } set { _isExpanded = value; OnPropertyChange("IsExpanded"); OnPropertyChange("Content"); } } public SomeType Content { get { if (!_isExpanded) return null; return LoadContent(); } }
source share