2

I have using tabbed page in my application. I have two views with same viewmodel. By using fresh mvvm how to navigate one page to another page with same viewmodel. Please anyone give your valuable suggestion. My tabbed page code,

var tabbedNavigation = new FreshTabbedNavigationContainer();
            tabbedNavigation.AddTab<MyViewPageModel>("View1", "View1.png", null);
var tabbedNavigation = new FreshTabbedNavigationContainer();
            tabbedNavigation.AddTab<MyViewPageModel>("View2", "View2.png", null);
Application.Current.MainPage.Navigation.PushAsync(tabbedNavigation); 
Anas Alweish
  • 2,818
  • 4
  • 30
  • 44
Yogeshwaran
  • 170
  • 12
  • Why do you want the same ViewModel to work with two different pages, does it not defeat the purpose? – FreakyAli Apr 08 '19 at 06:31
  • @G.hakim, I have Add and Edit page UI with different customization. But both views are same viewmodel. For navigating from button click I have used like this, **await CoreMethods.PushPageModel(null, true, false);**. But I have no idea, In tabbed view how to navigate with same viewmodel. – Yogeshwaran Apr 08 '19 at 06:44
  • I am pretty sure you do not need to show the PageModel which Page to refer it does it in the background for you! – FreakyAli Apr 08 '19 at 07:14
  • @G.hakim, you have any idea for tabbed page navigation with same viewmodel?. – Yogeshwaran Apr 08 '19 at 07:18
  • 1
    I am pretty sure what you are trying to do is not possible but good luck – FreakyAli Apr 08 '19 at 07:26

0 Answers0