ActivateItem doesn't seem to work with WPF Frame

Topics: Bugs, Feature Requests
Jan 29, 2014 at 11:38 PM
Trying to send a ViewModel to a WPF Frame doesn't work. If I replace the frame with ContentControl works fine.

I found a link where someone talks about how to fix this, but it means a modification to View.cs and I'd rather not modify the framework; it would cause a number of issues when my project moves to a different group for future maintenance and they didn't realize the framework was modified.

http://blog.davidsandor.com/post/2013/07/17/Using-Caliburn-Micro-with-WPF-Frame-for-navigation.aspx

Is there another work around or maybe a better way to do this?
Jan 30, 2014 at 3:11 PM
I changed my logic to the following to get this working the way a Navigation Frame would without using a Navigation Frame.

I removed the Frame and ContentPresenter and replaced them with DockPanel and ContentControl.

I then implemented a Conductor in my Main ViewModel to manage and own any open screens. The Main ViewModel/View is always active and acts like a frame with chrome elements.

I then subscribed to the EventAggregator in my Main ViewModel so any child ViewModel can call the Main ViewModel using a Message class and the Main ViewModel will handle the showing and closing of Views to the ContentControl using the Conductor.

I'm guessing this is similar to the way the BootStrapper works.

I'm new to Caliburn and MVVM so this a very different way of thinking. Hope this helps other avoid the Frame Navigation trap with MVVM.