How to organize page change?

How to organize the change pages using MVVM pattern and bindings? I can not find a sensible description. A method that I used to do it in WPF in Xamarin not work. :( Show working example please. Just be sure to meet MVVM. No handlers, only commands and bindings.

Tagged:

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    what does it mean "page changes"?

    OnAppearing and OnDisappearing?

  • DarkByteDarkByte RUMember

    @AlessandroCaliaro said:
    what does it mean "page changes"?

    OnAppearing and OnDisappearing?

    Switching pages. For example it was MainPage was DetailPage. I almost do not know English, can GoogleTranslate something wrong translated...

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    If you have to pass from PageA to PageB in MVVM, I think you should take a look at MVVM framework you use. I think every MVVM framework has its method.

    Otherwise, if you don't use MVVM frameworks, you can use something like

    Application.Current.MainPage = new PageB();
    

    or (if you are in a Navigation)

    Application.Current.MainPage.Navigation.PushAsync (new PageB());
    
  • DarkByteDarkByte RUMember

    I do not in principle to use a particular MVVM framework. The main thing that he observed pattern. It seems to me an option to Navigation.PushAsync does not fit into this pattern. Give any example please switch pages using MVVM. Though with the framework, though without.

Sign In or Register to comment.