示例#1
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="customer">The car to be shown.</param>
 /// <param name="repository">The car repository.</param>
 public CustomerViewModel(Customer customer, Repository repository)
     : base("New customer")
 {
     this.customer                         = customer;
     this.repository                       = repository;
     this.filteredOrderViewModel           = new MultiOrderViewModel(this.repository, this.customer);
     this.filteredOrderViewModel.AllOrders = this.FilteredOrders;
 }
示例#2
0
        public void ShowAllOrders()
        {
            MultiOrderViewModel viewModel = this.ViewModels.FirstOrDefault(vm => vm is MultiOrderViewModel) as MultiOrderViewModel;

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

            this.ActivateViewModel(viewModel);
        }