|
private void navigationDrawer_ItemClicked(object sender, Syncfusion.UI.Xaml.NavigationDrawer.NavigationItemClickedEventArgs e)
{
if ((string)e.Item.Header == "Home")
{
ActiveItem.Content = new HomeView();
}
else if ((string)e.Item.Header == "Books")
{
ActiveItem.Content = new BooksView();
}
} |
Hi Suganya,
Thank you a lot for the example. It is almost what I am looking for.
The command binding, navigation and MVVM are now (still) implemented in the code-behind. What I am looking for is to have that logic in the ViewModel instead of the code-behind.
I am trying to implement everything using the MVVMCROSS way: https://www.mvvmcross.com/documentation/fundamentals/viewmodel-lifecycle
I have been trying to get it to work, but unfortunately I am stuck and can't convert your example to what I am trying to achieve.
Hopefully you can help.
Thanks in advance.
Hi Suganya,
The logic and binding are still located in the Code-behind of the views. I want to move them to the ViewModels.
As mentioned I have 3 viewmodels, one for each view.
Also I want to make use of the MvxCommand from Mvvmcross instead of another one.
Looking forward to hearing from you.
Regards,
Moustafa
Dear Suganya,
Thank you for your reply.
Unfortunately this does not implement the view model lifecycle as proposed by MVVMCROSS. The logic is implemented in the code-behind.
I have shared two links below to give you more an as to what I wish to achieve.
https://www.mvvmcross.com/documentation/fundamentals/viewmodel-lifecycle
and
https://www.codeproject.com/Articles/5273075/MvvmCross-for-WPF-A-Basic-Primer
Looking forward to hearing from you!
Kind regards,
Moustafa