private void ProcessNote(CalendarNoteModel note) { _isEdit = note != null; CalendarNote = _isEdit ? note : GetCalendarNote(); CalendarNote.PropertyChanged += (sender, args) => SaveCommand.RaiseCanExecuteChanged(); }
public AddCalendarNoteView(CalendarNoteModel model = null) { InitializeComponent(); DataContext = ViewModel = new AddCalendarNoteViewModel(model); Owner = Application.Current.MainWindow; }
public AddCalendarNoteViewModel(CalendarNoteModel note) { var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>(); _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>(); SaveCommand = new RelayCommand(SaveCommandExecuted, SaveCommandCanExecute); CancelCommand = new RelayCommand(CancelCommandExecuted); ProcessNote(note); }