コード例 #1
0
        /// <summary>
        /// Command callback.
        /// Called to save current settings.
        /// </summary>
        private void OnSaveSettings()
        {
            bool needRestart = ContentViewModel.IsRestartNeeded();

            ContentViewModel.SaveSettings();
            Interface.Properties.Settings.Default.Save();

            if (needRestart)
            {
                MessageBox.Show(NavigationActor.Instance.ActiveWindow,
                                string.Format("Some changes will not take effect until the application is restarted."),
                                "Some settings need restart",
                                System.Windows.MessageBoxButton.OK,
                                System.Windows.MessageBoxImage.Information);
            }
        }
コード例 #2
0
        /// <summary>
        /// Command callback.
        /// Called to save current settings.
        /// </summary>
        private async void OnSaveSettings()
        {
            bool needRestart = ContentViewModel.IsRestartNeeded();

            ContentViewModel.SaveSettings();
            Interface.Properties.Settings.Default.Save();

            if (needRestart)
            {
                await MessageBoxManager.GetMessageBoxStandardWindow(new MessageBoxStandardParams
                {
                    ButtonDefinitions = ButtonEnum.Ok,
                    ContentTitle      = "Some settings need restart",
                    ContentMessage    = "Some changes will not take effect until the application is restarted.",
                    Icon = Icon.Info,
                }).ShowDialog(NavigationActor.Instance.MainWindow);
            }
        }