private void PlaceOrderAction()
        {
            if (IsOrderAvailable)
            {
                // Save to backend DB

                ThreadingHelpers.InvokeOnMainThread(async() =>
                                                    await AppNavigationService.GoToAsync(nameof(UserDashboardPage).ToLower(),
                                                                                         (UserDashboardPageViewModel vm) =>
                {
                    vm.UserDetails = App.UserDetails;
                    vm.Products    = this.Products;
                    //vm.Orders = Orders.Where(o => o.IsSubmitted).ToList();
                })
                                                    );
            }
            else
            {
                ThreadingHelpers.InvokeOnMainThread(async() =>
                {
                    AppInitialiserService.SetInitialiser <ProductCataloguePageViewModel>((ProductCataloguePageViewModel vm) =>
                    {
                        vm.UserDetails  = UserDetails;
                        vm.ProductTypes = App.MasterData.ProductTypeMaster;
                        //vm.ProductList = Products;
                        //vm.Product = new Product();
                        //vm.ProductTypes = App.MasterData.ProductTypeMaster;
                    });

                    await AppNavigationService.GoToAsync(nameof(ProductCataloguePage).ToLower());
                });
            }
        }
Example #2
0
        protected virtual async Task OnShellNavigatingIn(string sender, ShellNavigatingEventArgs args)
        {
            ShellNavigatingEventArgs = args;

            if (this.GetType() != typeof(AppShellViewModel) && this.GetType() != typeof(MainViewModel))
            {
                CurrentViewModelType = this.GetType();
            }

            AppInitialiserService.Initialise(this);
        }
Example #3
0
        protected virtual async Task OnShellNavigated(string sender, ShellNavigatedEventArgs args)
        {
            ShellNavigatedEventArgs = args;

            if (AppNavigationService.NavigationDirection == NavigationDirection.Backwards)
            {
                AppInitialiserService.Initialise(this);
            }

            OnNavigatedComplete?.Invoke();

            // reset navigation direction
            AppNavigationService.NavigationDirection = NavigationDirection.Forward;
        }
        private void AddProductAction()
        {
            ThreadingHelpers.InvokeOnMainThread(async() =>
            {
                AppInitialiserService.SetInitialiser <AddProductPageViewModel>((AddProductPageViewModel vm) =>
                {
                    vm.UserDetails  = UserDetails;
                    vm.ProductList  = Products;
                    vm.Product      = new Product();
                    vm.ProductTypes = App.MasterData.ProductTypeMaster;
                    vm.IsAddProduct = true;
                });

                await AppNavigationService.GoToAsync(nameof(AddProductPage).ToLower());
            });
        }
        private async Task EditProductAction(Product item)
        {
            AppSpinner.ShowLoading();
            await Task.Delay(10);

            ThreadingHelpers.InvokeOnMainThread(async() =>
            {
                AppInitialiserService.SetInitialiser <ProductCataloguePageViewModel>((ProductCataloguePageViewModel vm) =>
                {
                    vm.UserDetails = UserDetails;
                    vm.Products    = Products;
                });
                await AppNavigationService.GoToAsync(nameof(ProductCataloguePage).ToLower());

                //await AppNavigationService.GoBackAsync();
            }
                                                );

            AppSpinner.HideLoading();
        }
Example #6
0
        public async Task EditProductAction(Product item)
        {
            AppSpinner.ShowLoading();
            await Task.Delay(10);

            ThreadingHelpers.InvokeOnMainThread(async() =>
            {
                AppInitialiserService.SetInitialiser <AddProductPageViewModel>((AddProductPageViewModel vm) =>
                {
                    vm.UserDetails  = UserDetails;
                    vm.ProductList  = Products;
                    vm.Product      = item;
                    vm.IsAddProduct = false;
                });

                await AppNavigationService.GoBackAsync();
            }
                                                );

            AppSpinner.HideLoading();
        }