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
|
|
@ -27,6 +27,9 @@ namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
|
|
||||||
|
WindowState = WindowState.Minimized;
|
||||||
|
Activated += MainWindow_Activated;
|
||||||
|
|
||||||
App.Current.SessionEnding += Current_SessionEnding;
|
App.Current.SessionEnding += Current_SessionEnding;
|
||||||
this.Closing += MainWindow_Closing;
|
this.Closing += MainWindow_Closing;
|
||||||
|
|
@ -217,6 +220,14 @@ namespace v2rayN.Views
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
ViewModel?.ShowHideWindow(false);
|
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)
|
private void menuExit_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue