private void TearableTabDropDetector_TabDrop(object sender, TabDropEventArgs args) { TearableTabDropDetector ttdd = sender as TearableTabDropDetector; if (null != ttdd) { if (ttdd == ttddLeft) { if (DropLocation.Center == args.Location) { ttcLeft.DropTab(args.TearableTab); } else { AddSplitControl(args.Location, DropLocation.Left, args.TearableTab); } } else if (ttdd == ttddRight) { if (DropLocation.Center == args.Location) { ttcRight.DropTab(args.TearableTab); } else { AddSplitControl(args.Location, DropLocation.Right, args.TearableTab); } } else { new NotSupportedException("Object not supported"); } } }
private void DetachHandlers(TearableTabDropDetector ttdd) { if (null != ttdd) { ttdd.TabDrop -= TearableTabDropDetector_TabDrop; } }
private void TearableTabDropDetector_TabDrop(object sender, TabDropEventArgs args) { TearableTabDropDetector ttdd = sender as TearableTabDropDetector; if (null != ttdd) { if (ttdd == ttddTop) { if (DropLocation.Center == args.Location) { ttcTop.DropTab(args.TearableTab); } else { AddSplitControl(args.Location, DropLocation.Top, args.TearableTab); } } else if (ttdd == ttddBottom) { if (DropLocation.Center == args.Location) { ttcBottom.DropTab(args.TearableTab); } else { AddSplitControl(args.Location, DropLocation.Bottom, args.TearableTab); } } else { new NotSupportedException("Object not supported"); } } }
public void Remove(ref ITabControlContainer itcc, ref TearableTabControl ttc, ref TearableTabDropDetector ttdd, TearableTabControl ttcToBeInserted, int insertIndex) { gridContentVertical.Children.Remove(itcc as UIElement); itcc = null; ttc = ttcToBeInserted; AttachHandlers(ttc); ttdd.Visibility = Visibility.Visible; ttdd.AttachDetectorElement(ttc); gridContentVertical.Children.Insert(0, ttc); Grid.SetColumn(ttc, insertIndex); }