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;
//disable minimize button
ControlBox.SetHasMinimizeButton(dfw, false);
}
}
}
How do I go about adding Aero Snap functionality to this?