Example #1
0
        public SettingsVM()
        {
            WindowTitle = "Настройки";

            Label   = Properties.Settings.Default.Title;
            EndDate = Properties.Settings.Default.EndDate;

            OkClick     = new RelayCommand(() => ViewNavigator.CloseLastView());
            GoBackClick = new RelayCommand(() => ViewNavigator.CloseLastView(false));
            CloseClick  = new RelayCommand(() => ViewNavigator.CloseWindow());
        }
Example #2
0
        public CountDownVM()
        {
            WindowTitle = Properties.Settings.Default.Title;
            EndDate     = Properties.Settings.Default.EndDate;

            var timer = new DispatcherTimer();

            timer.Tick    += timer_Tick;
            timer.Interval = new TimeSpan(500000);
            timer.Start();

            CloseClick    = new RelayCommand(() => ViewNavigator.CloseWindow());
            SettingsClick = new RelayCommand(() => ViewNavigator.NavigateTo(new SettingsVM(), null, viewModel =>
            {
                Properties.Settings.Default.Title   = WindowTitle = viewModel.Label;
                Properties.Settings.Default.EndDate = EndDate = viewModel.EndDate;
            }));
        }