2. In overlay mode, change the border to opaque.
private bool isInterceptTouch = false;
private Timer overlayTimer;
+ private Color overlayBackgroundColor;
// for border area
private View rootView = null;
InterceptTouchEvent += OnWinInterceptTouch;
if (rootView != null)
{
+ overlayBackgroundColor = new Color(rootView.BackgroundColor);
+ rootView.BackgroundColor = new Color(1, 1, 1, 0.3f);
rootView.Hide();
}
}
GetBorderWindowBottomLayer().LowerToBottom();
if (rootView != null)
{
+ rootView.BackgroundColor = overlayBackgroundColor;
rootView.Show();
}
}
}
else if (direction != Window.BorderDirection.None)
{
+ OnRequestResize();
BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
}
}
if (e.Touch.GetState(0) == PointStateType.Down)
{
ClearWindowGesture();
- if (BorderWindow.IsMinimized() == true)
- {
- BorderWindow.RequestResizeToServer(Window.ResizeDirection.TopLeft);
- }
- else
- {
- BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomLeft);
- }
+ OnRequestResize();
+ BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomLeft);
}
return true;
}
if (e.Touch.GetState(0) == PointStateType.Down)
{
ClearWindowGesture();
- if (BorderWindow.IsMinimized() == true)
- {
- BorderWindow.RequestResizeToServer(Window.ResizeDirection.TopRight);
- }
- else
- {
- BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomRight);
- }
+ OnRequestResize();
+ BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomRight);
}
return true;
}
}
/// <summary>
+ /// Called when requesting a resize
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnRequestResize()
+ {
+ }
+
+ /// <summary>
/// Called when the window is resized.
/// </summary>
/// <param name="width">The width of the resized window</param>
public void OnCreated(View rootView);
/// <summary>
+ /// Called when requesting a resize
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void OnRequestResize();
+
+ /// <summary>
/// Called when the window is resized.
/// </summary>
/// <param name="width">The width of the resized window</param>
void Initialize()
{
win = NUIApplication.GetDefaultWindow();
-
- List<Window.WindowOrientation> list = new List<Window.WindowOrientation>();
- list.Add(Window.WindowOrientation.Landscape);
- list.Add(Window.WindowOrientation.LandscapeInverse);
- list.Add(Window.WindowOrientation.NoOrientationPreference);
- list.Add(Window.WindowOrientation.Portrait);
- list.Add(Window.WindowOrientation.PortraitInverse);
- win.SetAvailableOrientations(list);
-
var root = new ImageView()
{
WidthResizePolicy = ResizePolicyType.FillToParent,