첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
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

댓글을 달아 주세요