Is a service to show another window?

Feb 4, 2011 at 1:09 PM

Why isnt an services to show windows like IUIVisualizer is for popups. ?
I want to show a view window from my view model. I dont want to call direct ViewResolver to create my view , cast it to window and
show it. And i dont want to create it with new. I want a services to help me with test.

In my project: LoginViewModel must show MainWindow after login.

Sorry again for your time.

Coordinator
Feb 7, 2011 at 12:55 PM
Edited Feb 7, 2011 at 12:57 PM

All of this is discussed in the articles where I talk about WorkspaceData (http://www.codeproject.com/KB/WPF/CinchV2_3.aspx#Workspaces), and you may also want to check out the PRISM interop article that shows another way using regions (http://www.codeproject.com/KB/WPF/CinchV2AndPRISM4.aspx)

 

If you are doing what you said when you said "I want to show a view window from my view model. I dont want to call direct ViewResolver to create my view , cast it to window and
show it" You are way off the trail, and that is not what I intended at all, you need to read around the workspaces section and examine the WPF demo, to see how new views are created, or use the PRISM interop idea if you not mind using 2 libraries.

 

The way Cinch works is you add Workspaces to a List / or single property off your current ViewModel, and that is used to create views for you for the ItemsControl or ContentControl using attached DP called "NavProps". All this is discussed in detail in the article links above, and is shown in the WPF demo app