1. Added OnMaximize() and OnMinimize() APIs so that you can know when Maximize/Minimize is called.
2. Adds a Focusable to the icon.
GetDefaultLayer().Name = "OriginalRootLayer";
+ SetTransparency(true);
+ BackgroundColor = Color.Transparent;
+ borderInterface.BorderWindow = this;
+
if (CreateBorder() == true)
{
+ using var realWindowSize = new Size2D(WindowSize.Width, WindowSize.Height);
+
isBorderWindow = true;
Resized += OnBorderWindowResized;
+ borderInterface.OnCreated(borderView);
+
// Increase the window size as much as the border area.
if (isTop) borderHeight += borderInterface.BorderHeight;
if (isBottom) borderHeight += borderInterface.BorderHeight;
// When running the app for the first time, if it runs in full size, do Maximize(true).
if (screenWidth != 0 && screenHeight != 0 &&
- Size.Width >= screenWidth && Size.Height >= screenHeight &&
+ realWindowSize.Width >= screenWidth && realWindowSize.Height >= screenHeight &&
IsMaximized() == false)
{
Maximize(true);
+ borderInterface.OnMaximize(true);
ResizedEventArgs e = new ResizedEventArgs();
e.WindowSize = WindowSize;
OnBorderWindowResized(this, e);
// Add a view to the border layer.
GetBorderWindowBottomLayer().Add(rootView);
- SetTransparency(true);
- BackgroundColor = Color.Transparent;
- borderInterface.BorderWindow = this;
-
- borderInterface.OnCreated(borderView);
-
InterceptTouchEvent += (s, e) =>
{
if (e.Touch.GetState(0) == PointStateType.Down && IsMaximized() == false)
ushort padding = (ushort) borderInterface.BorderLineThickness;
borderView = new View()
{
+ GrabTouchAfterLeave = true,
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
BackgroundColor = Color.Transparent,
minimalizeIcon = new ImageView()
{
+ Focusable = true,
ResourceUrl = MinimalizeIcon,
};
maximalizeIcon = new ImageView()
{
+ Focusable = true,
ResourceUrl = MaximalizeIcon,
};
closeIcon = new ImageView()
{
+ Focusable = true,
ResourceUrl = CloseIcon,
};
leftCornerIcon = new ImageView()
{
+ Focusable = true,
ResourceUrl = LeftCornerIcon,
};
rightCornerIcon = new ImageView()
{
- ResourceUrl = RightCornerIcon,
+ Focusable = true,
+ ResourceUrl = RightCornerIcon,
};
RelativeLayout.SetRightTarget(minimalizeIcon, maximalizeIcon);
if (BorderWindow.IsMaximized())
{
BorderWindow.Maximize(false);
+ OnMaximize(false);
}
else
{
BorderWindow.Minimize(true);
+ OnMinimize(true);
}
}
else
{
BorderWindow.Maximize(true);
+ OnMaximize(true);
}
}
}
if (BorderWindow.IsMaximized() == true)
{
BorderWindow.Maximize(false);
+ OnMaximize(false);
}
else
{
{
ClearWindowGesture();
BorderWindow.Minimize(true);
+ OnMinimize(true);
}
return true;
}
if (BorderWindow.IsMaximized())
{
BorderWindow.Maximize(false);
+ OnMaximize(false);
}
else
{
BorderWindow.Maximize(true);
+ OnMaximize(true);
}
}
return true;
if (BorderWindow.IsMaximized() == false)
{
BorderWindow.Maximize(true);
+ OnMaximize(true);
}
else
{
BorderWindow.Maximize(false);
+ OnMaximize(false);
}
}
else
if (BorderWindow.IsMaximized() == true)
{
BorderWindow.Maximize(false);
+ OnMaximize(false);
}
else
{
UpdateIcons();
}
+ /// <summary>
+ /// Called when the window is maximized.
+ /// </summary>
+ /// <param name="isMaximized">If window is maximized or unmaximized.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnMaximize(bool isMaximized)
+ {
+ UpdateIcons();
+ }
+
+ /// <summary>
+ /// Called when the window is minimized.
+ /// </summary>
+ /// <param name="isMinimized">If window is mnimized or unminimized.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnMinimize(bool isMinimized)
+ {
+ UpdateIcons();
+ }
+
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void Dispose(bool disposing)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public void OnResized(int width, int height);
+ /// <summary>
+ /// Called when the window is maximized.
+ /// </summary>
+ /// <param name="isMaximized">If window is maximized or unmaximized.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void OnMaximize(bool isMaximized);
+
+ /// <summary>
+ /// Called when the window is minimized.
+ /// </summary>
+ /// <param name="isMinimized">If window is minimized or unminimized.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void OnMinimize(bool isMinimized);
+
}
}