private static void OnDockTreeSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DockControl dockControl = (DockControl)d; Dock dock = GetDock(e.Property); ResizeDockTreeData oldValue = new ResizeDockTreeData(dock, (SplitterDistance)e.OldValue); ResizeDockTreeData newValue = new ResizeDockTreeData(dock, (SplitterDistance)e.NewValue); dockControl.OnValueChanged(oldValue, newValue, delegate(ResizeDockTreeData oldData, ResizeDockTreeData newData) { Debug.Assert(oldData.Dock == newData.Dock); if (oldData.Dock == Dock.Left) { return(new ResizeLeftDockTreeCommand(oldData.Value, newData.Value)); } else if (oldData.Dock == Dock.Right) { return(new ResizeRightDockTreeCommand(oldData.Value, newData.Value)); } else if (oldData.Dock == Dock.Top) { return(new ResizeTopDockTreeCommand(oldData.Value, newData.Value)); } else { Debug.Assert(oldData.Dock == Dock.Bottom); return(new ResizeBottomDockTreeCommand(oldData.Value, newData.Value)); } }); }
private static void OnDockTreeZOrderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DockControl dockControl = (DockControl)d; dockControl.OnValueChanged((DockTreeZOrder)e.OldValue, (DockTreeZOrder)e.NewValue, delegate(DockTreeZOrder oldValue, DockTreeZOrder newValue) { return(new UpdateDockTreeZOrderCommand(oldValue, newValue)); }); }
private static void OnBoundsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FloatingWindow floatingWindow = (FloatingWindow)d; DockControl dockControl = floatingWindow.DockControl; if (dockControl == null) { return; } Rect oldBounds = floatingWindow.GetBounds(e.Property, (double)e.OldValue); Rect newBounds = floatingWindow.GetBounds(e.Property, (double)e.NewValue); UpdateBoundsData oldValue = new UpdateBoundsData(floatingWindow, oldBounds); UpdateBoundsData newValue = new UpdateBoundsData(floatingWindow, newBounds); dockControl.OnValueChanged(oldValue, newValue, delegate(UpdateBoundsData oldData, UpdateBoundsData newData) { return(new UpdateBoundsCommand(oldData.FloatingWindow, oldData.Value, newData.Value)); }); }