public ResultPageViewModel(/*Stopwatch model,*/ IRegionManager regionManager)
        {
            this.RegionManager = regionManager;
            StateStore.Store.ObserveOnDispatcher().Subscribe(state =>
            {
                LapTimes.Clear();
                LapTimes.AddRange(state.GetState <ObservableCollection <LapTime> >(ApplicationStateKey.LapTimeList));
            });

            //this.LapTimes = model.Items
            //    .ToReadOnlyReactiveCollection(x => new LapTimeViewModel(x));

            BackCommand = new DelegateCommand(Back);
        }
Exemplo n.º 2
0
        private void StopImpl()
        {
            switch (timerState)
            {
            case TimerState.Running:
                stopWatch.Stop();
                TimerState = TimerState.Stopped;
                break;

            case TimerState.Stopped:
                if (!dialogService.Confirm("Are you sure you want to start new?", "Confirm"))
                {
                    return;
                }
                stopWatch.Reset();
                LapTimes.Clear();
                TimerState = TimerState.Initial;
                break;

            case TimerState.Initial:
            default:
                throw new ArgumentOutOfRangeException();
            }
        }