mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-26 18:24:43 +00:00
启动时不显示窗口直接隐藏到任务栏,但仍会在托盘有短暂显示
This commit is contained in:
parent
3ab992f5fb
commit
5dc5c175d8
1 changed files with 11 additions and 0 deletions
|
|
@ -28,6 +28,9 @@ namespace v2rayN.Views
|
|||
InitializeComponent();
|
||||
_config = LazyConfig.Instance.GetConfig();
|
||||
|
||||
WindowState = WindowState.Minimized;
|
||||
Activated += MainWindow_Activated;
|
||||
|
||||
App.Current.SessionEnding += Current_SessionEnding;
|
||||
this.Closing += MainWindow_Closing;
|
||||
this.PreviewKeyDown += MainWindow_PreviewKeyDown;
|
||||
|
|
@ -218,6 +221,14 @@ namespace v2rayN.Views
|
|||
ViewModel?.ShowHideWindow(false);
|
||||
}
|
||||
|
||||
private void MainWindow_Activated(object sender, EventArgs e)
|
||||
{
|
||||
if (WindowState == WindowState.Minimized)
|
||||
{
|
||||
WindowState = WindowState.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
private void menuExit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
tbNotify.Dispose();
|
||||
|
|
|
|||
Loading…
Reference in a new issue