Exemplo n.º 1
0
 public static void UpdateDataGrids(DateTime date)
 {
     EditUserControlViewModel.GetInstance().UpdateTransactions(date);
     ViewUserControlViewModel.GetInstance().UpdateTransactions(new List <DateTime> {
         date
     });
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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);
 }