Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

New Post: [Version 2.0] MVVM multiple views loaded via user controls

$
0
0

Thought the code snippet might help, In the LayoutItem.cs file, we have modified below line of code which was originally

Model = model.Content   

 

// Modified code : Added casting with UserControl as we are using Collection of UserControl instead of Collection of ViewModel

Model = (model.Content as UserControl).DataContext;

This was to allow us to handle the observable collection of Views/UserControls then derive the viewModel from them.


Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>