1

Resolved

Some little issues...

description

  • when pulling a child window upper of the visible space, we can't click on the title bar to bring back the window.
     
  • the children resizing doesn't behave correctly with resizable component (just replace Width with ActualWidth somewhere in DragDelta events)
     
  • Adding the Cascade, Tile Windows Horizontally, and Tile Windows Vertically functionalities would be great.
     
    If I find other issues, I will post here.
     
     
    Anyway, good job and thanks for this code.
     
    Regards.

comments

stbear wrote Dec 10, 2010 at 11:14 AM

Hi,
First I wanna thank developers for the awesome code.
Regarding first issue, we don't want MdiChild to have negative coordinates in Canvas.
You need to fix 3 methods in MdiChild.cs:

private void dragThumb_DragDelta(object sender, DragDeltaEventArgs e)
{
if (WindowState == WindowState.Maximized)
    return;

double newLeft = Canvas.GetLeft(this) + e.HorizontalChange,
    newTop = Canvas.GetTop(this) + e.VerticalChange;

if (newLeft < 0)
    newLeft = 0;
if (newTop < 0)
    newTop = 0;

Canvas.SetLeft(this, newLeft);
Canvas.SetTop(this, newTop);

Container.InvalidateSize();
}

private void ResizeLeft_DragDelta(object sender, DragDeltaEventArgs e)
{
if (Width - e.HorizontalChange < MinWidth)
    return;

double newLeft = e.HorizontalChange;

if (Canvas.GetLeft(this) + newLeft < 0)
    newLeft = 0 - Canvas.GetLeft(this);

Width -= newLeft;
Canvas.SetLeft(this, Canvas.GetLeft(this) + newLeft);

if (sender != null)
    Container.InvalidateSize();
}

private void ResizeTop_DragDelta(object sender, DragDeltaEventArgs e)
{
if (Height - e.VerticalChange < MinHeight)
    return;

double newTop = e.VerticalChange;

if (Canvas.GetTop(this) + newTop < 0)
    newTop = 0 - Canvas.GetTop(this);

Height -= newTop;
Canvas.SetTop(this, Canvas.GetTop(this) + newTop);

if (sender != null)
    Container.InvalidateSize();
}

wrote Dec 11, 2010 at 5:12 PM

wrote Dec 11, 2010 at 5:13 PM

wrote Dec 11, 2010 at 8:20 PM

wrote Feb 25, 2011 at 1:17 PM

wrote Feb 22, 2013 at 12:13 AM

wrote May 16, 2013 at 11:45 AM

wrote May 16, 2013 at 11:45 AM

wrote Jun 14, 2013 at 8:25 AM