diff --git a/ILSpy/Options/DisplaySettingsPanel.xaml b/ILSpy/Options/DisplaySettingsPanel.xaml
index 7b62df65c..71d4e8b63 100644
--- a/ILSpy/Options/DisplaySettingsPanel.xaml
+++ b/ILSpy/Options/DisplaySettingsPanel.xaml
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
- xmlns:local="clr-namespace:ICSharpCode.ILSpy.Options">
+ xmlns:local="clr-namespace:ICSharpCode.ILSpy.Options"
+ xmlns:system="clr-namespace:System;assembly=mscorlib">
@@ -35,25 +36,25 @@
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
diff --git a/ILSpy/Options/OptionsDialog.xaml b/ILSpy/Options/OptionsDialog.xaml
index f8b9232fb..7dd6d38df 100644
--- a/ILSpy/Options/OptionsDialog.xaml
+++ b/ILSpy/Options/OptionsDialog.xaml
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
- Style="{DynamicResource DialogWindow}"
+ xmlns:options="clr-namespace:ICSharpCode.ILSpy.Options"
+ Style="{DynamicResource DialogWindow}"
WindowStartupLocation="CenterOwner"
ResizeMode="CanResizeWithGrip"
Title="{x:Static properties:Resources.Options}" Height="500" Width="600">
@@ -13,7 +14,18 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ILSpy/Options/OptionsDialog.xaml.cs b/ILSpy/Options/OptionsDialog.xaml.cs
index 7e3d20277..166f335ec 100644
--- a/ILSpy/Options/OptionsDialog.xaml.cs
+++ b/ILSpy/Options/OptionsDialog.xaml.cs
@@ -21,12 +21,26 @@ using System.ComponentModel.Composition;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Media;
using System.Xml.Linq;
using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy.Options
{
+ public class TabItemViewModel
+ {
+ public TabItemViewModel(string header, UIElement content)
+ {
+ Header = header;
+ Content = content;
+ }
+
+ public string Header { get; }
+ public UIElement Content { get; }
+ }
+
///
/// Interaction logic for OptionsDialog.xaml
///
@@ -46,9 +60,8 @@ namespace ICSharpCode.ILSpy.Options
ILSpySettings settings = ILSpySettings.Load();
foreach (var optionPage in optionPages.OrderBy(p => p.Metadata.Order))
{
- TabItem tabItem = new TabItem();
- tabItem.Header = MainWindow.GetResourceString(optionPage.Metadata.Title);
- tabItem.Content = optionPage.Value;
+ var tabItem = new TabItemViewModel(MainWindow.GetResourceString(optionPage.Metadata.Title), optionPage.Value);
+
tabControl.Items.Add(tabItem);
IOptionPage page = optionPage.Value as IOptionPage;
@@ -76,7 +89,7 @@ namespace ICSharpCode.ILSpy.Options
{
if (MessageBox.Show(Properties.Resources.ResetToDefaultsConfirmationMessage, "ILSpy", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
- var page = ((TabItem)tabControl.SelectedItem).Content as IOptionPage;
+ var page = tabControl.SelectedValue as IOptionPage;
if (page != null)
page.LoadDefaults();
}