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

■ 첫번째 LayoutAnchorablePane 찾기

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

using Xceed.Wpf.AvalonDock.Layout;

 

#region 첫번째 LayoutAnchorablePane 찾기 - FindFirstLayoutAnchorablePane(layoutAnchorablePaneGroup)

 

/// <summary>

/// 첫번째 LayoutAnchorablePane 찾기

/// </summary>

/// <param name="layoutAnchorablePaneGroup">LayoutAnchorablePaneGroup</param>

/// <returns>LayoutAnchorablePane</returns>

public LayoutAnchorablePane FindFirstLayoutAnchorablePane(LayoutAnchorablePaneGroup layoutAnchorablePaneGroup)

{

    LayoutAnchorablePane layoutAnchorablePane = null;

 

    foreach(ILayoutAnchorablePane layoutAnchorablePaneInterface in layoutAnchorablePaneGroup.Children)

    {

        if(layoutAnchorablePaneInterface is LayoutAnchorablePane)

        {

            return layoutAnchorablePaneInterface as LayoutAnchorablePane;

        }

 

        if(layoutAnchorablePaneInterface is LayoutAnchorablePaneGroup)

        {

            layoutAnchorablePane = FindFirstLayoutAnchorablePane(layoutAnchorablePaneInterface as LayoutAnchorablePaneGroup);

 

            if(layoutAnchorablePane != null)

            {

                return layoutAnchorablePane;

            }

        }

    }

 

    return null;

}

 

#endregion

 

#region 첫번째 LayoutAnchorablePane 찾기 - FindFirstLayoutAnchorablePane(layoutPanel)

 

/// <summary>

/// 첫번째 LayoutAnchorablePane 찾기

/// </summary>

/// <param name="layoutPanel">LayoutPanel</param>

/// <returns>LayoutAnchorablePane</returns>

public LayoutAnchorablePane FindFirstLayoutAnchorablePane(LayoutPanel layoutPanel)

{

    LayoutAnchorablePane layoutAnchorablePane = null;

 

    foreach(ILayoutPanelElement layoutPanelElementInterface in layoutPanel.Children)

    {

        if(layoutPanelElementInterface is LayoutAnchorablePane)

        {

            return layoutPanelElementInterface as LayoutAnchorablePane;

        }

 

        if(layoutPanelElementInterface is LayoutAnchorablePaneGroup)

        {

            layoutAnchorablePane = FindFirstLayoutAnchorablePane(layoutPanelElementInterface as LayoutAnchorablePaneGroup);

 

            if(layoutAnchorablePane != null)

            {

                return layoutAnchorablePane;

            }

        }

    }

 

    return null;

}

 

#endregion

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요