Exemplo n.º 1
0
 public ProductViewModel(Product product, Repository repository)
     : base("New product")
 {
     this.product    = product;
     this.repository = repository;
     this.filteredCategoryViewModel = new MultiCategoryViewModel(this.repository, this.product);
     this.filteredCategoryViewModel.AllCategories = this.FilteredCategories;
 }
Exemplo n.º 2
0
        public void ShowAllCategories()
        {
            MultiCategoryViewModel viewModel = this.ViewModels.FirstOrDefault(vm => vm is MultiCategoryViewModel) as MultiCategoryViewModel;

            if (viewModel == null)
            {
                viewModel = new MultiCategoryViewModel(repositorys);
                viewModel.RequestClose += this.OnWorkspaceRequestClose;
                this.ViewModels.Add(viewModel);
            }

            this.ActivateViewModel(viewModel);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Shows all products.
        /// </summary>
        public void ShowAllCategorys()
        {
            MultiCategoryViewModel viewModel = this.ViewModels.FirstOrDefault(vm => vm is MultiCategoryViewModel) as MultiCategoryViewModel;

            if (viewModel == null)
            {
                MultiCategoryViewModel mcvm = new MultiCategoryViewModel(this.repo);
                mcvm.RequestClose += this.OnWorkspaceRequestClose;
                this.ViewModels.Add(mcvm);
            }

            this.ActivateViewModel(viewModel);
        }