첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

■ 첫번째 LayoutDocumentPane 찾기

------------------------------------------------------------------------------------------------------------------------

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

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요