コード例 #1
0
ファイル: HomePageViewModel.cs プロジェクト: joagwa/EasyTechy
		/// <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;

				var database = new ECOdatabase ();
				database.DeleteAllInBuyList ();

				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 (() => {
				
			});
		}