/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public HomePageViewModel(IMyNavigationService navigationService) { this.navigationService = navigationService; ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} LogOutFunction = new Command (() => { App.LoggedIn = false; this.navigationService.NavigateToModal(ViewModelLocator.HomePageKey); }); GoToLoginPage = new Command (param => { var x = param as String; this.navigationService.NavigateTo (ViewModelLocator.LoginPageKey); }); GoToBuylistPage = new Command (() => { this.navigationService.NavigateTo (ViewModelLocator.BuylistPageKey); }); GoToCartPage = new Command (() => { this.navigationService.NavigateTo (ViewModelLocator.CartPageKey); }); GoToConnectPage = new Command (() => { this.navigationService.NavigateTo(ViewModelLocator.ConnectPageKey); }); GoToReceivePage = new Command (() => { this.navigationService.NavigateTo(ViewModelLocator.ReceivePageKey); }); GoToMapPage = new Command (() => { this.navigationService.NavigateTo(ViewModelLocator.MapPageKey); }); GoToScannerPage = new Command (async() => { var data = await DependencyService.Get<IScanner> ().Scan (); if(data != null){ var database = new ECOdatabase(); List<WoolworthsItem> resultSet = database.SearchWoolWorthsItem(data); } }); }