コード例 #1
0
        public MainViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService,
                             IHomeViewModel homeViewModel,
                             IAddMenuViewModel addMenuViewModel, IGoogleLoginViewModel googleLoginViewModel,
                             RegisterViewModel registerViewModel,
                             BottomChartViewModel bottomChartViewModel,
                             IBlRouter blRouter)
        {
            IsLoad               = true;
            RegisterViewModel    = registerViewModel;
            AddMenuViewModel     = addMenuViewModel;
            GoogleLoginViewModel = googleLoginViewModel;

            _eventAggregator      = eventAggregator;
            _messageDialogService = messageDialogService;
            _blRouter             = blRouter;
            getDateTime           = DateTime.Now;

            GetIsLogOn = false;

            Subscribe();
            CheckIsLogOn();
            _homeViewModel       = homeViewModel;
            HomeView             = new HomeView();
            HomeView.DataContext = _homeViewModel;
            OpenHome();
        }
コード例 #2
0
        public HomeViewModel(IEventAggregator eventAggregator,
                             BottomChartViewModel bottomChartViewModel,
                             IMessageDialogService messageDialogService,
                             IBlRouter blRouter)
        {
            BottomChartViewModel = bottomChartViewModel;
            this.Consume         = new Goal();
            _dateTime            = DateTime.Now;

            _eventAggregator = eventAggregator;
            _eventAggregator.GetEvent <BE.Events.SelectedDateChangedEvent>()
            .Subscribe(OnSelectedDateChanged);
            _eventAggregator.GetEvent <BE.Events.MealAddedEvent>().Subscribe(UpdateConsume);
            _eventAggregator.GetEvent <BE.Events.UserLogInSeccEvent>().Subscribe(UpdateData);
            _eventAggregator.GetEvent <BE.Events.GoalsIsUpdate>().Subscribe(UpdateGoal);
            _blRouter = blRouter;
            UpdateData();
        }