From 630b2e78aff24423027bafa3d8c0490dd578ef50 Mon Sep 17 00:00:00 2001 From: adrianlungu Date: Sat, 19 Sep 2020 13:11:35 +0300 Subject: [PATCH] Fix #2 --- ScreenSleep/App.xaml.cs | 1 + ScreenSleep/MainWindow.xaml | 5 +++-- ScreenSleep/MainWindow.xaml.cs | 2 ++ ScreenSleep/Properties/AssemblyInfo.cs | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ScreenSleep/App.xaml.cs b/ScreenSleep/App.xaml.cs index 901924c..56d0542 100644 --- a/ScreenSleep/App.xaml.cs +++ b/ScreenSleep/App.xaml.cs @@ -7,5 +7,6 @@ namespace ScreenSleep /// public partial class App : Application { + } } diff --git a/ScreenSleep/MainWindow.xaml b/ScreenSleep/MainWindow.xaml index 7c7716d..f008b57 100644 --- a/ScreenSleep/MainWindow.xaml +++ b/ScreenSleep/MainWindow.xaml @@ -7,10 +7,11 @@ xmlns:tb="http://www.hardcodet.net/taskbar" mc:Ignorable="d" WindowStyle="None" + WindowState="Minimized" ShowInTaskbar="False" ShowActivated="False" - Icon="Resources/icon.ico" - Title="MainWindow" Height="0" Width="0" + Visibility="Hidden" + Title="MainWindow" Height="1" Width="1" Loaded="MainWindow_OnLoaded"> diff --git a/ScreenSleep/MainWindow.xaml.cs b/ScreenSleep/MainWindow.xaml.cs index 3bc907f..1a5ca0a 100644 --- a/ScreenSleep/MainWindow.xaml.cs +++ b/ScreenSleep/MainWindow.xaml.cs @@ -41,6 +41,8 @@ private void Settings_OnClick(object sender, RoutedEventArgs e) private void TurnOff_OnClick(object sender, RoutedEventArgs e) { + if (MyNotifyIcon.ContextMenu != null) MyNotifyIcon.ContextMenu.IsOpen = false; + Screen.SetScreenState(ScreenState.Off); } diff --git a/ScreenSleep/Properties/AssemblyInfo.cs b/ScreenSleep/Properties/AssemblyInfo.cs index a5cd7d5..3875fbb 100644 --- a/ScreenSleep/Properties/AssemblyInfo.cs +++ b/ScreenSleep/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.2")] -[assembly: AssemblyFileVersion("1.0.0.2")] +[assembly: AssemblyVersion("1.0.0.3")] +[assembly: AssemblyFileVersion("1.0.0.3")]