public void UpdateSize(int width, int height)
{
// Can only apply change when fully showing
if (_state == DockingAutoHiddenShowState.Showing)
{
switch (_edge)
{
case DockingEdge.Left:
_endRect.Width += width;
_inner.SetBounds(0, 0, _inner.Width + width, _inner.Height);
SetBounds(Left, Top, Width + width, Height);
// Update the page with the new size to use in the future
if (_page != null)
_page.AutoHiddenSlideSize = new Size(_page.AutoHiddenSlideSize.Width + width, _page.AutoHiddenSlideSize.Height);
break;
case DockingEdge.Right:
_endRect.X += width;
_endRect.Width -= width;
_inner.SetBounds(0, 0, _inner.Width - width, _inner.Height);
SetBounds(Left + width, Top, Width - width, Height);
// Update the page with the new size to use in the future
if (_page != null)
_page.AutoHiddenSlideSize = new Size(_page.AutoHiddenSlideSize.Width - width, _page.AutoHiddenSlideSize.Height);
break;
case DockingEdge.Top:
_endRect.Height += width;
_inner.SetBounds(0, 0, _inner.Width, _inner.Height + height);
SetBounds(Left, Top, Width, Height + height);
// Update the page with the new size to use in the future
if (_page != null)
_page.AutoHiddenSlideSize = new Size(_page.AutoHiddenSlideSize.Width, _page.AutoHiddenSlideSize.Height + height);
break;
case DockingEdge.Bottom:
_endRect.Y += height;
_endRect.Height -= height;
_inner.SetBounds(0, 0, _inner.Width, _inner.Height - height);
SetBounds(Left, Top + height, Width, Height - height);
// Update the page with the new size to use in the future
if (_page != null)
_page.AutoHiddenSlideSize = new Size(_page.AutoHiddenSlideSize.Width, _page.AutoHiddenSlideSize.Height - height);
break;
}
}
}