public CustomerCardViewModel(IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator) { _container = container; _eventAggregator = eventAggregator; _regionManager = regionManager; this.NotificationRequest = new InteractionRequest<INotification>(); _clientLayer = new ClientLayer(); CurrentCustomer = new Customer(); _customerTypes = new ObservableCollection<CustomerType>(_clientLayer.GetAllCustomerTypes()); //CurrentCustomerType = _currentCustomer.CustomerType; }
private void EditCustomerDetails() { _currentCustomer = _collectionView.CurrentItem as Customer; if (_currentCustomer != null) { ShowCustomersDetails(false); } }
private void CreateCustomer(Customer customer) { ShowCustomersDetails(true); }
private void SelectedCustomerChanged(object sender, EventArgs e) { //для динамического просмотра _currentCustomer = _collectionView.CurrentItem as Customer; if (_currentCustomer != null) { _eventAggregator.GetEvent<CustomerSelectedEvent>().Publish(_currentCustomer.Id); } }
public void OnNavigatedTo(NavigationContext navigationContext) { _currentCustomer = (Customer)navigationContext.Parameters["CurrentCustomer"]; string status = (string)navigationContext.Parameters["StatusCustomer"]; if (_currentCustomer != null && status != "CancelCustomer") { if (status == "NewCustomer") _customers.Add(_currentCustomer); Customers.MoveCurrentTo(_currentCustomer); Customers.Refresh(); } }
public void OnNavigatedTo(NavigationContext navigationContext) { string status = (string)navigationContext.Parameters["StatusCustomer"]; if (status == "NewCustomer") { CurrentCustomer = new Customer(); CurrentCustomerType = null; } else if (status == "EditCustomer") { CurrentCustomer = (Customer)navigationContext.Parameters["CurrentCustomer"]; CurrentCustomerType = CurrentCustomer.CustomerType; } RemoveDetailsView(); }
private void CancelCustomerDetails() { NavigationParameters navigationParameters = new NavigationParameters(); navigationParameters.Add("CurrentCustomer", _currentCustomer); _regionManager.RequestNavigate(RegionNames.DetailRegion, ViewNames.CustomerDetailsView, navigationParameters); _currentCustomer = null; navigationParameters.Add("StatusCustomer", "CancelCustomer"); _regionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.CustomerListView, navigationParameters); //_regionManager.RequestNavigate(RegionNames.MainRegion, new Uri(ViewNames.CustomerListView, UriKind.Relative), navigationParameters); }
public void OnNavigatedTo(NavigationContext navigationContext) { CurrentCustomer = (Customer)navigationContext.Parameters["CurrentCustomer"]; }
private void CustomerSelected(int id) { CurrentCustomer = _clientLayer.GetCustomerById(id); }