■ 첫번째 LayoutDocumentPane 객체를 찾는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
using Xceed.Wpf.AvalonDock.Layout; #region 첫번째 LayoutDocumentPane 찾기 - FindFirstLayoutDocumentPane(layoutDocumentPaneGroup) /// <summary> /// 첫번째 LayoutDocumentPane 찾기 /// </summary> /// <param name="layoutDocumentPaneGroup">LayoutDocumentPaneGroup</param> /// <returns>LayoutDocumentPane</returns> public LayoutDocumentPane FindFirstLayoutDocumentPane(LayoutDocumentPaneGroup layoutDocumentPaneGroup) { LayoutDocumentPane layoutDocumentPane = null; foreach(ILayoutDocumentPane layoutDocumentPaneInterface in layoutDocumentPaneGroup.Children) { if(layoutDocumentPaneInterface is LayoutDocumentPane) { return layoutDocumentPaneInterface as LayoutDocumentPane; } if(layoutDocumentPaneInterface is LayoutDocumentPaneGroup) { layoutDocumentPane = FindFirstLayoutDocumentPane(layoutDocumentPaneInterface as LayoutDocumentPaneGroup); if(layoutDocumentPane != null) { return layoutDocumentPane; } } } return null; } #endregion #region 첫번째 LayoutDocumentPane 찾기 - FindFirstLayoutDocumentPane(layoutPanel) /// <summary> /// 첫번째 LayoutDocumentPane 찾기 /// </summary> /// <param name="layoutPanel">LayoutPanel</param> /// <returns>LayoutDocumentPane</returns> public LayoutDocumentPane FindFirstLayoutDocumentPane(LayoutPanel layoutPanel) { LayoutDocumentPane layoutDocumentPane = null; foreach(ILayoutPanelElement layoutPanelElementInterace in layoutPanel.Children) { if(layoutPanelElementInterace is LayoutDocumentPane) { return layoutPanelElementInterace as LayoutDocumentPane; } if(layoutPanelElementInterace is LayoutDocumentPaneGroup) { layoutDocumentPane = FindFirstLayoutDocumentPane(layoutPanelElementInterace as LayoutDocumentPaneGroup); if(layoutDocumentPane != null) { return layoutDocumentPane; } } } return null; } #endregion |