diff --git a/FloatingStatusWindowLibrary/FloatingStatusWindow.cs b/FloatingStatusWindowLibrary/FloatingStatusWindow.cs index f24297d..d00e619 100644 --- a/FloatingStatusWindowLibrary/FloatingStatusWindow.cs +++ b/FloatingStatusWindowLibrary/FloatingStatusWindow.cs @@ -20,6 +20,16 @@ namespace FloatingStatusWindowLibrary var contextMenu = new ContextMenu(); contextMenu.Opened += HandleContextMenuOpened; + var menuItem = new MenuItem + { + Name = "contextMenuChangeAppearance", + Header = Properties.Resources.ContextMenuChangeAppearance + }; + menuItem.Click += HandleChangeAppearancemMenuItemClick; + contextMenu.Items.Add(menuItem); + + contextMenu.Items.Add(new Separator()); + _lockMenuItem = new MenuItem { Name = "contextMenuItemLocked", @@ -31,7 +41,7 @@ namespace FloatingStatusWindowLibrary contextMenu.Items.Add(new Separator()); - var menuItem = new MenuItem + menuItem = new MenuItem { Name = "contextMenuItemExit", Header = Properties.Resources.ContextMenuExit @@ -52,6 +62,12 @@ namespace FloatingStatusWindowLibrary _mainWindow.Show(); } + void HandleChangeAppearancemMenuItemClick(object sender, RoutedEventArgs e) + { + var appearanceWindow = new AppearanceWindow(_mainWindow.WindowSettings); + appearanceWindow.ShowDialog(); + } + private void HandleMainWindowClosed(object sender, EventArgs e) { _taskbarIcon.Dispose(); diff --git a/FloatingStatusWindowLibrary/MainWindow.xaml b/FloatingStatusWindowLibrary/MainWindow.xaml index 8820ea4..dedd86e 100644 --- a/FloatingStatusWindowLibrary/MainWindow.xaml +++ b/FloatingStatusWindowLibrary/MainWindow.xaml @@ -15,13 +15,6 @@ - diff --git a/FloatingStatusWindowLibrary/MainWindow.xaml.cs b/FloatingStatusWindowLibrary/MainWindow.xaml.cs index eedc3ed..8020fbd 100644 --- a/FloatingStatusWindowLibrary/MainWindow.xaml.cs +++ b/FloatingStatusWindowLibrary/MainWindow.xaml.cs @@ -73,17 +73,6 @@ namespace FloatingStatusWindowLibrary HtmlLabel.Text = "Testing"; } - private void HandleChangeAppearanceMenuClick(object sender, RoutedEventArgs e) - { - var appearanceWindow = new AppearanceWindow(_windowSettings); - appearanceWindow.ShowDialog(); - } - - private void HandleSettingsButtonClick(object sender, RoutedEventArgs e) - { - SettingsButton.ContextMenu.IsOpen = true; - } - protected override void OnLocationChanged(EventArgs e) { base.OnLocationChanged(e); diff --git a/FloatingStatusWindowLibrary/Properties/Resources.Designer.cs b/FloatingStatusWindowLibrary/Properties/Resources.Designer.cs index c01d304..c0af1c3 100644 --- a/FloatingStatusWindowLibrary/Properties/Resources.Designer.cs +++ b/FloatingStatusWindowLibrary/Properties/Resources.Designer.cs @@ -88,20 +88,20 @@ namespace FloatingStatusWindowLibrary.Properties { } /// - /// Looks up a localized string similar to Change Appearance.... + /// Looks up a localized string similar to Change Appearance. /// - public static string ChangeAppearance { + public static string ChangeAppearanceWindow { get { - return ResourceManager.GetString("ChangeAppearance", resourceCulture); + return ResourceManager.GetString("ChangeAppearanceWindow", resourceCulture); } } /// /// Looks up a localized string similar to Change Appearance. /// - public static string ChangeAppearanceWindow { + public static string ContextMenuChangeAppearance { get { - return ResourceManager.GetString("ChangeAppearanceWindow", resourceCulture); + return ResourceManager.GetString("ContextMenuChangeAppearance", resourceCulture); } } diff --git a/FloatingStatusWindowLibrary/Properties/Resources.resx b/FloatingStatusWindowLibrary/Properties/Resources.resx index 4ce8693..8c72924 100644 --- a/FloatingStatusWindowLibrary/Properties/Resources.resx +++ b/FloatingStatusWindowLibrary/Properties/Resources.resx @@ -126,12 +126,12 @@ Center - - Change Appearance... - Change Appearance + + Change Appearance + Exit diff --git a/TestWindow/WindowSource.cs b/TestWindow/WindowSource.cs index 48f3c28..ee9bed3 100644 --- a/TestWindow/WindowSource.cs +++ b/TestWindow/WindowSource.cs @@ -1,5 +1,4 @@ -using System.Windows.Controls; -using FloatingStatusWindowLibrary; +using FloatingStatusWindowLibrary; using System; using System.Globalization; using System.Timers;