첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
본 블로그는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 블로그 콘텐츠 향상을 위해 쓰여집니다.

728x90
반응형
728x170
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
728x90
반응형
그리드형
Posted by 사용자 icodebroker
TAG , , ,

댓글을 달아 주세요