'宣言 Public Property SplitterOrientation As Orientation
public Orientation SplitterOrientation {get; set;}
Imports Infragistics.Windows.DockManager Private Sub InitializeDmSplitPanes(ByVal dockManager As XamDockManager) Dim splitHorz As New SplitPane() ' The SplitterOrientation determine the orientation ' of the splitter bar used to separate the children splitHorz.SplitterOrientation = Orientation.Horizontal ' since this will be a root split pane, we will initialize ' the default location such that it is docked on the left ' edge of the dockmanager XamDockManager.SetInitialLocation(splitHorz, InitialPaneLocation.DockedLeft) ' The RelativeSize is an attached property that is used ' to determine the percentage of the available space that ' should be assigned to the pane. In this example, since ' the splitter orientation is horizontal only the height ' will affect the size. The top pane will be given 2/3 ' of the available height since it has a relative size ' of 200/300 whereas the bottom pane has a relative size ' of 100/300. Dim cpTop As New ContentPane() cpTop.Header = "Top" cpTop.Content = "Top" SplitPane.SetRelativeSize(cpTop, New Size(100, 200)) Dim cpBottom As New ContentPane() cpBottom.Header = "Bottom" cpBottom.Content = "Bottom" SplitPane.SetRelativeSize(cpTop, New Size(100, 100)) ' note, the order in which the panes are added ' has an impact on their position. the first visible ' item is positioned on the left/top depending on ' the splitter orientation with the next pane following ' to the right/bottom respectively splitHorz.Panes.Add(cpTop) splitHorz.Panes.Add(cpBottom) ' create a second root split pane with a vertical splitter between ' the items Dim splitVert As New SplitPane() splitVert.SplitterOrientation = Orientation.Vertical XamDockManager.SetInitialLocation(splitVert, InitialPaneLocation.DockedBottom) ' Here the RelativeSize is not set so each gets an ' equal percentage and the available width will be ' evenly distributed between the panes Dim cpLeft As New ContentPane() cpLeft.Content = "Left" cpLeft.Header = "Left" splitVert.Panes.Add(cpLeft) Dim tgMiddle As New TabGroupPane() Dim cpTab1 As New ContentPane() cpTab1.Header = "Tab 1" cpTab1.Content = "1" tgMiddle.Items.Add(cpTab1) Dim cpTab2 As New ContentPane() cpTab2.Header = "Tab 2" cpTab2.Content = "2" tgMiddle.Items.Add(cpTab2) splitVert.Panes.Add(tgMiddle) Dim cpRight As New ContentPane() cpRight.Header = "Right" cpRight.Content = "Right" splitVert.Panes.Add(cpRight) dockManager.Panes.Add(splitHorz) dockManager.Panes.Add(splitVert) End Sub
using Infragistics.Windows.DockManager; private void InitializeDmSplitPanes(XamDockManager dockManager) { SplitPane splitHorz = new SplitPane(); // The SplitterOrientation determine the orientation // of the splitter bar used to separate the children splitHorz.SplitterOrientation = Orientation.Horizontal; // since this will be a root split pane, we will initialize // the default location such that it is docked on the left // edge of the dockmanager XamDockManager.SetInitialLocation(splitHorz, InitialPaneLocation.DockedLeft); // The RelativeSize is an attached property that is used // to determine the percentage of the available space that // should be assigned to the pane. In this example, since // the splitter orientation is horizontal only the height // will affect the size. The top pane will be given 2/3 // of the available height since it has a relative size // of 200/300 whereas the bottom pane has a relative size // of 100/300. ContentPane cpTop = new ContentPane(); cpTop.Header = "Top"; cpTop.Content = "Top"; SplitPane.SetRelativeSize(cpTop, new Size(100, 200)); ContentPane cpBottom = new ContentPane(); cpBottom.Header = "Bottom"; cpBottom.Content = "Bottom"; SplitPane.SetRelativeSize(cpTop, new Size(100, 100)); // note, the order in which the panes are added // has an impact on their position. the first visible // item is positioned on the left/top depending on // the splitter orientation with the next pane following // to the right/bottom respectively splitHorz.Panes.Add(cpTop); splitHorz.Panes.Add(cpBottom); // create a second root split pane with a vertical splitter between // the items SplitPane splitVert = new SplitPane(); splitVert.SplitterOrientation = Orientation.Vertical; XamDockManager.SetInitialLocation(splitVert, InitialPaneLocation.DockedBottom); // Here the RelativeSize is not set so each gets an // equal percentage and the available width will be // evenly distributed between the panes ContentPane cpLeft = new ContentPane(); cpLeft.Content = "Left"; cpLeft.Header = "Left"; splitVert.Panes.Add(cpLeft); TabGroupPane tgMiddle = new TabGroupPane(); ContentPane cpTab1 = new ContentPane(); cpTab1.Header = "Tab 1"; cpTab1.Content = "1"; tgMiddle.Items.Add(cpTab1); ContentPane cpTab2 = new ContentPane(); cpTab2.Header = "Tab 2"; cpTab2.Content = "2"; tgMiddle.Items.Add(cpTab2); splitVert.Panes.Add(tgMiddle); ContentPane cpRight = new ContentPane(); cpRight.Header = "Right"; cpRight.Content = "Right"; splitVert.Panes.Add(cpRight); dockManager.Panes.Add(splitHorz); dockManager.Panes.Add(splitVert); }