protected override void FloatTabExecuted(FloatEventArgs e) { var item = e.DataContext as TabModel; Children.Remove(item); var model = new WindowViewModel { IsRafted = true }; var group = new DocumentWellModel(); group.Children.Add(item); model.Content = new DocContainerModel(group); var wnd = new RaftedWindow { Model = model, Left = e.VisualBounds.X, Top = e.VisualBounds.Y, Width = e.VisualBounds.Width, Height = e.VisualBounds.Height }; model.Host = wnd; if (ParentViewModel != null && ParentViewModel.IsRafted && !ParentViewModel.AllTabs.Any()) { ShowOnClose(ParentViewModel.Host, wnd); } else { wnd.Show(); wnd.DragMove(); } }
private void InnerDock(DockEventArgs e) { var index = Parent.Children.IndexOf(this); if (e.TargetDock == DockTarget.SplitRight || e.TargetDock == DockTarget.SplitBottom) { index++; } var orientation = e.TargetDock == DockTarget.SplitLeft || e.TargetDock == DockTarget.SplitRight ? Orientation.Horizontal : Orientation.Vertical; var groups = e.SourceContent.OfType <TabWellModelBase>().ToList(); var newGroup = new DocumentWellModel(); foreach (var group in groups) { var allChildren = group.Children.ToList(); foreach (var item in allChildren) { group.Children.Remove(item); item.IsPinned = false; item.IsActive = false; newGroup.Children.Add(item); } } Parent.Orientation = orientation; Parent.Children.Insert(index, newGroup); foreach (var child in Parent.Children) { child.PanelSize = new GridLength(1, GridUnitType.Star); } e.SourceWindow.Close(); }
private void DockExecuted(DockEventArgs e) { var groups = e.SourceContent.OfType <TabWellModelBase>().ToList(); var newGroup = new DocumentWellModel(); foreach (var group in groups) { var allChildren = group.Children.ToList(); foreach (var item in allChildren) { group.Children.Remove(item); item.IsPinned = false; item.IsActive = false; newGroup.Children.Add(item); } } e.SourceWindow.Close(); Children.Add(newGroup); newGroup.IsActive = true; newGroup.SelectedItem = newGroup.Children[0]; }
public DocContainerModel(DocumentWellModel initial) : this() { Children.Add(initial); }