예제 #1
0
        private async void OnEditCommandExecute(object item)
        {
            ProductModel model = item as ProductModel;

            if (model != null)
            {
                var vm     = new ManageProductViewModel(this.Categories, WebApiClient, model);
                var result = await this.ShowDialogAsync(vm);
            }
        }
예제 #2
0
        private async void OnNewCommandExecute()
        {
            var vm     = new ManageProductViewModel(this.Categories, WebApiClient);
            var result = await this.ShowDialogAsync(vm);

            if (result ?? false)
            {
                if (vm.Uri != null)
                {
                    this.IsBusy = true;

                    Product newOne = await WebApiClient.GetAsync <Product>(vm.Uri);

                    this.Products.Add(Mapper.Map <ProductModel>(newOne));

                    this.IsBusy = false;
                }
            }
        }