예제 #1
0
        private void OpenSettingsFunc(object param)
        {
            var settingsView = new TraceLab.UI.WPF.Views.SettingsPage();

            settingsView.DataContext = SettingsViewModel;

            var settingsWindow = new System.Windows.Window();

            settingsWindow.Content = settingsView;
            SetWindowOwner(settingsWindow);
            settingsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            settingsWindow.ShowActivated         = true;
            settingsWindow.Title         = "Settings";
            settingsWindow.Icon          = new BitmapImage(new Uri("pack://application:,,,/TraceLab.UI.WPF;component/Resources/Icon_Settings16.png"));
            settingsWindow.ResizeMode    = ResizeMode.NoResize;
            settingsWindow.SizeToContent = SizeToContent.WidthAndHeight;

            bool?result = settingsWindow.ShowDialog();

            if (result == true)
            {
                SettingsViewModel.ApplyChanges();
            }
        }
        private void OpenSettingsFunc(object param)
        {
            var settingsView = new TraceLab.UI.WPF.Views.SettingsPage();
            settingsView.DataContext = SettingsViewModel;

            var settingsWindow = new System.Windows.Window();
            settingsWindow.Content = settingsView;
            SetWindowOwner(settingsWindow);
            settingsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            settingsWindow.ShowActivated = true;
            settingsWindow.Title = "Settings";
            settingsWindow.Icon = new BitmapImage(new Uri("pack://application:,,,/TraceLab.UI.WPF;component/Resources/Icon_Settings16.png"));
            settingsWindow.ResizeMode = ResizeMode.NoResize;
            settingsWindow.SizeToContent = SizeToContent.WidthAndHeight;

            bool? result = settingsWindow.ShowDialog();
            if (result == true)
            {
                SettingsViewModel.ApplyChanges();
            }
        }