WPF MVVM Framework - Serialize/Deserialize a View's Size and State with LayoutSerializationService and CurrentWindowSerializationBehavior
The CurrentWindowSerializationBehavior allows you to serialize/deserialize settings (size and state) of the associated view (or window). The behavior uses the LayoutSerializationService to serialize/deserialize a view's settings.
To save/restore view settings, assign the CurrentWindowSerializationBehavior to the view and invoke the Serialize/Deserialize methods in the Initialized event hander.
You should define the CurrentWindowSerializationBehavior at the same hierarchical level with the LayoutSerializationService or lower.
To deserialize view settings on the application startup, use the Initialized event.
- ViewModelState.cs (VB: ViewModelState.vb)
- DocumentViewModel.cs (VB: DocumentViewModel.vb)
- MainViewModel.cs (VB: MainViewModel.vb)
- DocumentView.xaml (VB: DocumentView.xaml)
- MainView.xaml (VB: MainView.xaml)
(you will be redirected to DevExpress.com to submit your response)