I have Expander from WPF (and using Entity Framework 4 and MVVM pattern) which contains ContentControl bound to some inner ViewModel. All I want is to bind this content control LAZILY. That is I want my ViewModel to be “get” when the Expander is opened.
How to do that? How to make complex windows with inner ViewModels faster?
You could add an
IsExpandedproperty to your ViewModel, bind the expander to it, and take the value of that property into account when returning the content of theContentControl: