Beispiel #1
0
 public static void UpdateDataGrids(DateTime date)
 {
     EditUserControlViewModel.GetInstance().UpdateTransactions(date);
     ViewUserControlViewModel.GetInstance().UpdateTransactions(new List <DateTime> {
         date
     });
 }
Beispiel #2
0
 public static ViewUserControlViewModel GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ViewUserControlViewModel();
     }
     return(_instance);
 }
Beispiel #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);
 }