Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
xamDockManger, MVVM and DependencyObject-based ViewModels
posted

Hi,

I am trying to make xamDockManager work in the following scenario:

- MVVM mode - mainwindow's viewmodel (MainWindowVM) is DependencyObject exposing ObservableCollection of child ViewModelBases, also a DependencyObject (PageBaseVM)

- each page view model (Page1VM, Page2VM), etc is inherited from PageBaseVM and has its own DataTemplate with matching user control inside

- I need to have those pages appear as Tabbed MDI with ability to resize/rearrange, etc without floating out

I came across two different Infragistics.Windows.Extensions projects here on this forum but neither had any help - I am getting a whole bunch of NullReferenceExceptions or, after some changes, InvalidCast exception (Page1VM <> ContentPane).

I have tried to replace colleciton of page VMs to collection of ContentPanes, which I succeeded with, but instead of expected result i got several square panes docked one below another with wrong DataContext (DataTemplate was not applied).

Due to corporate policy, i am unable to provide any sample but to reproduce NREs it is enough to change

Window_DockBindingViewModel : Infragistics.PropertyChangeNotifier

to

Window_DockBindingViewModel : DependencyObject

and adjust code from normal properties to DependencyProperty-based.

Any ideas which direction can i expore next to get job done?

Cheers,

Alex