From 13ee8985d783f1ee90d48b547b77af4b108e27d8 Mon Sep 17 00:00:00 2001 From: Daniel Chalmers Date: Tue, 3 Jan 2017 21:54:54 -0500 Subject: [PATCH] Add "Topmost" context menu option --- Network Monitor/App.config | 3 +++ Network Monitor/MainWindow.xaml | 6 +++++- Network Monitor/Properties/Settings.Designer.cs | 12 ++++++++++++ Network Monitor/Properties/Settings.settings | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Network Monitor/App.config b/Network Monitor/App.config index 9f5edc3..bb7f68d 100644 --- a/Network Monitor/App.config +++ b/Network Monitor/App.config @@ -29,6 +29,9 @@ 00:00:01 + + True + \ No newline at end of file diff --git a/Network Monitor/MainWindow.xaml b/Network Monitor/MainWindow.xaml index ca4d146..5f14ab1 100644 --- a/Network Monitor/MainWindow.xaml +++ b/Network Monitor/MainWindow.xaml @@ -12,7 +12,7 @@ SizeToContent="WidthAndHeight" ResizeMode="NoResize" WindowStyle="None" - Topmost="True" + Topmost="{Binding Topmost, Source={x:Static properties:Settings.Default}, Mode=TwoWay}" AllowsTransparency="True" Background="Transparent" Closing="MainWindow_OnClosing" @@ -22,6 +22,10 @@ + + diff --git a/Network Monitor/Properties/Settings.Designer.cs b/Network Monitor/Properties/Settings.Designer.cs index f8d0a69..7dcdbcd 100644 --- a/Network Monitor/Properties/Settings.Designer.cs +++ b/Network Monitor/Properties/Settings.Designer.cs @@ -82,5 +82,17 @@ public string PingHost { this["Interval"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Topmost { + get { + return ((bool)(this["Topmost"])); + } + set { + this["Topmost"] = value; + } + } } } diff --git a/Network Monitor/Properties/Settings.settings b/Network Monitor/Properties/Settings.settings index 63c67f0..302f7c4 100644 --- a/Network Monitor/Properties/Settings.settings +++ b/Network Monitor/Properties/Settings.settings @@ -19,5 +19,8 @@ 00:00:01 + + True + \ No newline at end of file