첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
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
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요