|
@@ -13,20 +13,32 @@ using fis.Managers.Interfaces;
|
|
|
using Avalonia.Threading;
|
|
|
using fis.Utilities;
|
|
|
using fis.Win.Utilities;
|
|
|
+using System.Linq;
|
|
|
|
|
|
namespace fis
|
|
|
{
|
|
|
public partial class MainWindow : BaseWindow
|
|
|
{
|
|
|
private const string ThisWindowName = "Main";
|
|
|
+ private WindowState _windowState = WindowState.Normal;
|
|
|
+
|
|
|
|
|
|
public MainWindow()
|
|
|
{
|
|
|
AvaloniaXamlLoader.Load(this);
|
|
|
+ WindowName = "Main";
|
|
|
InitializeComponent();
|
|
|
InitializeMainComponent();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ protected override void HandleWindowStateChanged(WindowState state)
|
|
|
+ {
|
|
|
+ _windowState = state;
|
|
|
+ string[] list = { ((int)state).ToString() };
|
|
|
+ BrowserManager.ExecuteJS(TargetMethodName.OnWindowStateChange, list.ToList());
|
|
|
+ }
|
|
|
+
|
|
|
private void InitializeMainComponent()
|
|
|
{
|
|
|
|
|
@@ -41,6 +53,7 @@ namespace fis
|
|
|
{
|
|
|
if (e == ThisWindowName)
|
|
|
{
|
|
|
+ _windowState = WindowState.Normal;
|
|
|
WindowDragingHelper.BeginWindowDrag(e);
|
|
|
}
|
|
|
};
|
|
@@ -56,6 +69,12 @@ namespace fis
|
|
|
{
|
|
|
if (e == ThisWindowName)
|
|
|
{
|
|
|
+ if (_windowState == WindowState.Maximized)
|
|
|
+ {
|
|
|
+ WindowDragingHelper.RestoreWindow(e);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _windowState = WindowState.Maximized;
|
|
|
WindowDragingHelper.MaximizeWindow(e);
|
|
|
}
|
|
|
};
|
|
@@ -63,6 +82,7 @@ namespace fis
|
|
|
{
|
|
|
if (e == ThisWindowName)
|
|
|
{
|
|
|
+ _windowState = WindowState.Minimized;
|
|
|
WindowDragingHelper.MinimizeWindow(e);
|
|
|
}
|
|
|
};
|
|
@@ -70,17 +90,14 @@ namespace fis
|
|
|
{
|
|
|
if (e == ThisWindowName)
|
|
|
{
|
|
|
+ _windowState = WindowState.Normal;
|
|
|
WindowDragingHelper.RestoreWindow(e);
|
|
|
}
|
|
|
};
|
|
|
winFisBrowser.WindowClosed += OnBrowserCloseTheWindow;
|
|
|
}
|
|
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
|
|
-#if DEBUG
|
|
|
-
|
|
|
-#else
|
|
|
WindowState = WindowState.Maximized;
|
|
|
-#endif
|
|
|
AppManager.ParentWindow = this;
|
|
|
Closed += OnMainWindowClosed;
|
|
|
}
|