public static void UpdateDataGrids(DateTime date) { EditUserControlViewModel.GetInstance().UpdateTransactions(date); ViewUserControlViewModel.GetInstance().UpdateTransactions(new List <DateTime> { date }); }
internal void TransactionPropertyChanged(object sender, PropertyChangedEventArgs e) { Transaction updatedTransaction = sender as Transaction; updatedTransaction.PropertyChanged -= EditUserControlViewModel.GetInstance().TransactionPropertyChanged; updatedTransaction.HasUpdated = true; updatedTransaction.ModifiedDate = DateTimeHelper.PstNow(); updatedTransaction.PropertyChanged += EditUserControlViewModel.GetInstance().TransactionPropertyChanged; ChangesMade = true; }
private MainWindowViewModel() { AddUserControlViewModel = AddUserControlViewModel.GetInstance(); AddUserControlViewModel.Date = DateTimeHelper.PstNow(); EditUserControlViewModel = EditUserControlViewModel.GetInstance(); EditUserControlViewModel.Date = DateTimeHelper.PstNow(); ViewUserControlViewModel = ViewUserControlViewModel.GetInstance(); ViewUserControlViewModel.Dates = new List <DateTime> { DateTimeHelper.PstNow() }; SelectedTabIndex = 0; SelectionMode = CalendarSelectionMode.SingleRange; IObservable <int> tabSelection = this.WhenAnyValue(x => x.SelectedTabIndex); SelectedDateObservable = this.WhenAnyValue(x => x.SelectedDate); IObserver <int> updateRadioButton = Observer.Create <int>( tabIndex => UpdateRadioButtonSelection(tabIndex)); SelectedDateObservable.Subscribe(AddUserControlViewModel.DateTimeObserver); SelectedDateObservable.Subscribe(EditUserControlViewModel.DateTimeObserver); tabSelection.Subscribe(updateRadioButton); SelectedDate = DateTimeHelper.PstNow(); Classes = new ObservableCollection <AssetClass>(AssetClass.ConstructTestData()); }
private void PushCategories() { AddUserControlViewModel.GetInstance().GetAllCategories(); EditUserControlViewModel.GetInstance().GetAllCategories(); ViewUserControlViewModel.GetInstance().UpdateTransactions(ViewUserControlViewModel.GetInstance().Dates); }