What do you think about the development process in a C#/XAML app for Windows 8. When we are starting developing an application for this platform we should never forget about MVVM. A great framework for this is Caliburn.Micro. It is a pretty simple and clean framework, with a lot of extensions points.
When we will try to navigate between screens we will use INavigationService.NavigateToViewModel<TDestionViewModel>. This will work great.
To be able to access this parameter, you’ll need to define a parameter in your destination ViewModel named Parameter, with the same time as your parameter that you specify when you call the navigation method.
Enjoy!
When we will try to navigate between screens we will use INavigationService.NavigateToViewModel<TDestionViewModel>. This will work great.
Navigation.NavigateToViewModel<MyFooPageViewModel>();
Each ViewModel need to implement the Screen class. This will give access to all the features that we need in the view mode. But what about sending data from one view to another. The method NavigateToViewModel can accept an parameter of type object.Navigation.NavigateToViewModel<MyFooPageViewModel>(“some data”);
Looks good but you will be surprised when you will try to get this data in your destination ViewModel. You will not be able to find this data anywhere. To be able to access this parameter, you’ll need to define a parameter in your destination ViewModel named Parameter, with the same time as your parameter that you specify when you call the navigation method.
public class MyFooViewModel : Screen
{
public string Parameter {
get {...}
set {...}
...
}
Don't forget that the Parameter property is set after the ViewModel is created. Because of this, in the setter you should process the input data. Enjoy!
Comments
Post a Comment