protected override void AddPane(RadDocking radDocking, RadPane pane) { var paneModel = pane.DataContext as PaneViewModel; if (paneModel != null && !(paneModel.IsDocument)) { RadPaneGroup group = null; switch (paneModel.InitialPosition) { case DockState.DockedRight: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "rightGroup") as RadPaneGroup; if (group != null) { group.Items.Add(pane); } return; case DockState.DockedBottom: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "bottomGroup") as RadPaneGroup; if (group != null) { group.Items.Add(pane); } return; case DockState.DockedLeft: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "leftGroup") as RadPaneGroup; if (group != null) { group.Items.Add(pane); } return; case DockState.FloatingDockable: var fdSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer(); group = radDocking.GeneratedItemsFactory.CreatePaneGroup(); fdSplitContainer.Items.Add(group); group.Items.Add(pane); radDocking.Items.Add(fdSplitContainer); pane.MakeFloatingDockable(); return; case DockState.FloatingOnly: var foSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer(); group = radDocking.GeneratedItemsFactory.CreatePaneGroup(); foSplitContainer.Items.Add(group); group.Items.Add(pane); radDocking.Items.Add(foSplitContainer); pane.MakeFloatingOnly(); return; case DockState.DockedTop: default: return; } } base.AddPane(radDocking, pane); }
protected override void AddPane(RadDocking radDocking, RadPane pane) { var paneViewModel = pane.DataContext as DetectivePaneViewModelBase; if (paneViewModel != null) { radDocking.PaneStateChange += this.RadDocking_PaneStateChange; RadPaneGroup group = null; switch (paneViewModel.DockPositionPosition) { case DetectiveDockPosition.DockedDocument: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "DockedDocument") as RadPaneGroup; @group?.Items.Add(pane); return; case DetectiveDockPosition.DockedRight: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "DockedRight") as RadPaneGroup; @group?.Items.Add(pane); return; case DetectiveDockPosition.DockedBottom: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "DockedBottom") as RadPaneGroup; @group?.Items.Add(pane); return; case DetectiveDockPosition.DockedLeft: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "DockedLeft") as RadPaneGroup; @group?.Items.Add(pane); return; case DetectiveDockPosition.FloatingDockable: var fdSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer(); group = radDocking.GeneratedItemsFactory.CreatePaneGroup(); fdSplitContainer.Items.Add(group); group.Items.Add(pane); radDocking.Items.Add(fdSplitContainer); pane.MakeFloatingDockable(); return; case DetectiveDockPosition.FloatingOnly: var foSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer(); group = radDocking.GeneratedItemsFactory.CreatePaneGroup(); foSplitContainer.Items.Add(group); group.Items.Add(pane); radDocking.Items.Add(foSplitContainer); pane.MakeFloatingOnly(); return; case DetectiveDockPosition.DockedTop: default: return; } } base.AddPane(radDocking, pane); }
private void ButtonFloating_Click(object sender, RoutedEventArgs e) { var splitContainer = new RadSplitContainer(); var paneGroup = new RadPaneGroup(); var pane = new RadPane { Header = "Floating pane" }; RadDocking.SetFloatingLocation(pane, new Point(100, 100)); paneGroup.Items.Add(pane); splitContainer.Items.Add(paneGroup); dock.Items.Add(splitContainer); pane.MakeFloatingDockable(); }
protected override void AddPane(RadDocking radDocking, RadPane pane) { var paneModel = pane.DataContext as PaneViewModel; if (paneModel != null && !(paneModel.IsDocument)) { RadPaneGroup group = null; switch (paneModel.InitialPosition) { case DockState.DockedRight: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "rightGroup") as RadPaneGroup; if (group != null) { group.Items.Add(pane); } return; case DockState.DockedBottom: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "bottomGroup") as RadPaneGroup; if (group != null) { group.Items.Add(pane); } return; case DockState.DockedLeft: group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "leftGroup") as RadPaneGroup; if (group != null) { group.Items.Add(pane); } return; case DockState.FloatingDockable: var fdSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer(); group = radDocking.GeneratedItemsFactory.CreatePaneGroup(); fdSplitContainer.Items.Add(group); group.Items.Add(pane); radDocking.Items.Add(fdSplitContainer); pane.MakeFloatingDockable(); return; case DockState.FloatingOnly: var foSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer(); group = radDocking.GeneratedItemsFactory.CreatePaneGroup(); foSplitContainer.Items.Add(group); group.Items.Add(pane); radDocking.Items.Add(foSplitContainer); pane.MakeFloatingOnly(); return; case DockState.DockedTop: default: return; } } base.AddPane(radDocking, pane); }
private void ButtonFloating_Click(object sender, RoutedEventArgs e) { var splitContainer = new RadSplitContainer(); var paneGroup = new RadPaneGroup(); var pane = new RadPane { Header = "Floating pane" }; RadDocking.SetFloatingLocation(pane, new Point(100, 100)); paneGroup.Items.Add(pane); splitContainer.Items.Add(paneGroup); dock.Items.Add(splitContainer); pane.MakeFloatingDockable(); }
private void PositionPanel(RadPane radPane, PanelPosition position) { //logger.LogDebug($"PositionPanel - position {position}"); log.Trace($"{nameof(PositionPanel)}({nameof(position)}: {position})"); if (locked) { LockRadPane(radPane); } else { UnlockRadPane(radPane); } switch (position) { case PanelPosition.DockedBottom: case PanelPosition.DockedLeft: case PanelPosition.DockedRight: case PanelPosition.DockedTop: case PanelPosition.Document: { if (docking.SplitItems.ToList().FirstOrDefault(i => i.Control.Tag is PanelPosition pos && pos == position) is RadPaneGroup group) { group.Items.Add(radPane); } return; } case PanelPosition.FloatingDockable: case PanelPosition.FloatingOnly: { var split = docking.GeneratedItemsFactory.CreateSplitContainer(); var group = docking.GeneratedItemsFactory.CreatePaneGroup(); split.Items.Add(group); group.Items.Add(radPane); docking.Items.Add(split); if (position == PanelPosition.FloatingDockable) { radPane.MakeFloatingDockable(); } else { radPane.MakeFloatingOnly(); } return; } default: throw new ArgumentException($"Panel default position '{position}' is not a valid value"); } }