by Paul Stovell via Paul Stovell on 11/8/2009 2:39:23 AM
Magellan is a lightweight framework that makes it easy to build WPF navigation applications. It is inspired by the ASP.NET MVC framework. The main features are:
Magellan was drawn from a number of samples I had put together early this year and some work done on a client project.
The source download includes an "iPhone" application for demonstrating the features.
We start with a simple project structure:
A controller implementation typically looks like this:
public class PhoneController : Controller { public ActionResult Group(Group group) { var contacts = _contactRepository.GetContacts(group); Model = new GroupViewModel(group.Name, contacts); return View(); }
Views are XAML Page objects, and can optionally have a model. Here's an example:
The idea is that upon navigation, a controller is created, the action is executed, and the view and view model are created. The view then becomes the focus of the frame. Put simply, the view and viewmodel are stateful, and the controller is stateless.
Navigation between views (with nice transitions) can be done either programatically:
Navigator.For(Frame).NavigateWithTransition("Home", "Main", "ZoomOut");
Or through Blend behaviors:
The framework supports the ASP.NET MVC concepts of Action Filters, Model Binders, View Engines and more - I'll cover them in a later post.
Original Post: Magellan
The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.