Esempio n. 1
0
 public MainViewModel(UserInfo user, IDetailedScreen screen = null)
 {
     DetailScreen = (screen ?? Locator.Current.GetService<IDetailedScreen>());
     Locator.CurrentMutable.RegisterConstant(this, typeof(MainViewModel));
     Locator.CurrentMutable.RegisterConstant(new BasketViewModel(), typeof(BasketViewModel));
     Locator.CurrentMutable.RegisterConstant(new FoodsViewModel(), typeof(FoodsViewModel));
     FoodViewModel = Locator.Current.GetService<FoodsViewModel>();
     BasketViewModel = Locator.Current.GetService<BasketViewModel>();
     User = user;
 }
 public void NavigateToMainPage(UserInfo user)
 {
     user.Picture = Helper.Address + "/" + user.Picture;
     var mainViewModel = new MainViewModel(user);
     NavigationScreen.Navigation.NavigateToMainPage.Execute(mainViewModel);
 }