コード例 #1
0
        /// <summary>
        /// Opens the settings window, with an optional specific tab
        /// </summary>
        /// <param name="specificTab">Type of tab to open</param>
        private void OpenSettings(Type specificTab = null)
        {
            if (this.settingsView != null && !this.settingsView.IsClosed)
            {
                this.settingsView.Focus();
            }
            else
            {
                this.settingsView = new SettingsView();
                this.Container.ComposeParts(this.settingsView);
                this.settingsView.Show();
            }

            if (specificTab != null)
            {
                foreach (TabItem item in this.settingsView.SettingsTabControl.Items)
                {
                    if (item.Content.GetType() == specificTab)
                    {
                        this.settingsView.SettingsTabControl.SelectedItem = item;
                        break;
                    }
                }

            }
        }
コード例 #2
0
 /// <summary>
 /// Shuts down the settings view controller
 /// </summary>
 public void Shutdown()
 {
     if (this.settingsView != null && !this.settingsView.IsClosed)
     {
         Threading.InvokeOnUI(() =>
             {
                 this.settingsView.Close();
                 this.settingsView = null;
             });
     }
 }