public LayoutAccessor(Layout layout) { Layout = layout ?? throw new ArgumentNullException(nameof(layout)); if (Layout.Content is Branch branch) { BranchAccessor = new BranchAccessor(branch); } else { TabablzControl = Layout.VisualTreeDepthFirstTraversal().OfType <TabablzControl>().FirstOrDefault(); } }
public LayoutAccessor(Layout layout) { if (layout == null) { throw new ArgumentNullException("layout"); } _layout = layout; var branch = Layout.Content as Branch; if (branch != null) { _branchAccessor = new BranchAccessor(branch); } else { _tabablzControl = Layout.VisualTreeDepthFirstTraversal().OfType <TabablzControl>().FirstOrDefault(); } }