I've done several WPF application(not using MVVM) in the past and I had always to implement my own system of navigation between view(instantiate the view once, and then load in a container component, with refreshing required components of my view).
It works, but:
- It's always custom, so if a new developer comes he has to learn of it how it works
- I'm pretty sure that It's not the most optimized(most of things haven't been done in background worker, ...)
- It's a time loss
So I was wondering if there is an official way to handle this ? I don't exactly how, but I was thinking to a navigation component, which can act a little like a tab panel, or a little like the MVC framework in asp.net, we can 开发者_开发百科call a specified controller for an action and some parameters.
Maybe deactiviting bindings when they aren't in the current view
You can use DataTemplates/Styles to customize content of your control ( not only apearance, but data, cause that what you're asking for I presume)
http://msdn.microsoft.com/en-us/library/ms742521.aspx
You can have one Host control and at runtime change its appearance based on events/ states.
Like an example can have a look here: http://code.google.com/p/svnradar/ how this program manages a appearance of Group and Flat view of repository information.
Another example: Podder of Josh Smith
http://joshsmithonwpf.wordpress.com/2008/03/05/podder-v2-has-been-released/
Hope this helps.
You may be interested by Lakana, a lightweight (but powerful) framework that can handle for you all the navigation concerns !
Riana
精彩评论