/// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="regionManager"></param>
        /// <param name="eventAggregator"></param>
        public HistoriesPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            // インタフェースを受け取る
            _regionManager   = regionManager;
            _eventAggregator = eventAggregator;

            // コマンドを定義
            GoBackCommand = new DelegateCommand(ExecuteGoBackCommand);

            Sessions = SessionsDataStore.GetSessions();
        }
        /// <summary>
        /// 抽選を停止する
        /// </summary>
        private void ExecuteStopCommand()
        {
            _dispatcherTimer.Stop();
            IsStopped = true;

            var session = new Session()
            {
                Name   = DateTime.Now.ToString("yyyy/MM/dd (ddd) HH:mm:ss"),
                Result = Result
            };

            SessionsDataStore.AddSession(session);
        }
예제 #3
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="regionManager"></param>
        /// <param name="eventAggregator"></param>
        public TopPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            // インタフェースを受け取る
            _regionManager   = regionManager;
            _eventAggregator = eventAggregator;

            // コマンドを定義
            AddUserToSelectedUsersCommand = new DelegateCommand(ExecuteAddUserToSelectedUsersCommand, CanExecuteAddUserToSelectedUsersCommand);
            AddUserToSelectedUsersCommand.ObservesProperty(() => SelectedUserInAllUsers);
            RemoveUserFromSelectedUsersCommand = new DelegateCommand(ExecuteRemoveUserFromSelectedUsersCommand, CanExecuteRemoveUserFromSelectedUsersCommand);
            RemoveUserFromSelectedUsersCommand.ObservesProperty(() => SelectedUserInSelectedUsers);
            StartCommand = new DelegateCommand(ExecuteStartCommand, CanExecuteStartCommand);
            StartCommand.ObservesProperty(() => SelectedUsers.Count);
            ConfigureUsersCommand = new DelegateCommand(ExecuteConfigureUsersCommand);
            ShowHistoriesCommand  = new DelegateCommand(ExecuteShowHistoriesCommand, CanExecuteShowHistoriesCommand);
            ShowHistoriesCommand.ObservesProperty(() => Sessions.Count);

            AllUsers = UsersDataStore.GetUsers();
            Sessions = SessionsDataStore.GetSessions();
        }
예제 #4
0
 public MainWindowViewModel()
 {
     // 初期化処理
     UsersDataStore.Initialize();
     SessionsDataStore.Initialize();
 }