mirror of
https://github.com/2dust/v2rayN.git
synced 2025-09-01 15:56:19 +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();
|
||||
_config = LazyConfig.Instance.GetConfig();
|
||||
|
||||
WindowState = WindowState.Minimized;
|
||||
Activated += MainWindow_Activated;
|
||||
|
||||
App.Current.SessionEnding += Current_SessionEnding;
|
||||
this.Closing += MainWindow_Closing;
|
||||
|
@ -217,6 +220,14 @@ namespace v2rayN.Views
|
|||
e.Cancel = true;
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue