This project is read-only.

Maximize and Aero snap on DockableFloatingWindow.

Jun 6, 2011 at 8:06 AM

I have the following code to give a undocked floating AvalonDock window the ability to maximize:

 

class MaximizableDockableContent : AvalonDock.DockableContent
{
    public MaximizableDockableContent()
        : base()
    {
         base.StateChanged += MaximizableDockableContent_StateChanged;
    }

    private void MaximizableDockableContent_StateChanged(
        object sender, RoutedEventArgs e)
    {
        MaximizableDockableContent mdc = (MaximizableDockableContent)sender;
        if (mdc.State == DockableContentState.DockableWindow)
        {
            base.FloatingWindowSizeToContent = SizeToContent.WidthAndHeight;
            FloatingDockablePane fdp = (FloatingDockablePane)base.Parent;
            DockableFloatingWindow dfw = (DockableFloatingWindow)fdp.Parent;

            //dfw.WindowState = WindowState.Maximized;
            dfw.WindowStyle = WindowStyle.ThreeDBorderWindow;
            dfw.ResizeMode = ResizeMode.CanResize;

            
        }
    }
}


How do I go about adding Aero Snap functionality to this?