public StatusOfFollowUpView(FollowUpStatus followUpStatus) { InitializeComponent(); DataContext = _viewModel = new StatusOfFollowUpViewModel(followUpStatus); Loaded += OnCRMViewLoaded; Unloaded += StatusOfFollowUpView_Unloaded; }
public StatusOfFollowUpViewModel(FollowUpStatus followUpStatus) { IsDirty = false; var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>(); _adminDataUnit = dataUnitLocator.ResolveDataUnit <IAdminDataUnit>(); _followUpStatus = followUpStatus; SaveChangesCommand = new RelayCommand(SaveChangesCommandExecuted, SaveChangesCommandCanExecute); FollowUpStatus.PropertyChanged += StatusOfFollowUp_PropertyChanged; }
private async void AddTODOStatusCommandExecuted() { var status = new FollowUpStatus { Color = "#808080", ID = Guid.NewGuid(), NumberOfDays = 0, Priority = 1, Status = "New TODO Status", StatusType = Convert.ToInt32(StatusType.ToDosStatus) }; _adminDataUnit.FollowUpStatusesRepository.Add(status); await _adminDataUnit.SaveChanges(); TODOStatuses.Add(status); SelectedObject = status; IsToDoStatusesTreeExpanded = true; }