public AppViewModel() { ViewModelBase loginViewModel = ViewsFactory.CreateView("GameWindowView"); loginViewModel.OnViewChange += LoginViewModel_OnViewChange; CurrentView = loginViewModel; }
private void App_OnViewChange(object sender, PropertyChangedEventArgs e) { ViewModelBase viewModel = ViewsFactory.CreateView(e.PropertyName); viewModel.OnViewChange += LoginViewModel_OnViewChange; CurrentView = viewModel; }
public async Task NavigateToAsync <View, ViewModel>(ViewModel viewModel) where View : Page where ViewModel : BaseViewModel { View page = ViewsFactory.CreateView <View>(); page.BindingContext = viewModel; await GetMainPage().PushAsync(page); }