public void then_first_header_in_bindable_horizontal_list_has_add_commands()
        {
            SectionViewModel     unitySectionVM       = configurationSourceModel.Sections.Single(x => x.SectionName == UnityConfigurationSection.SectionName);
            HorizontalListLayout unitySectionBindable = (HorizontalListLayout)unitySectionVM.Bindable;

            HeaderLayout firstHeaderViewModel = unitySectionBindable.Current as HeaderLayout;

            Assert.IsNotNull(firstHeaderViewModel);
            Assert.IsNotNull(firstHeaderViewModel.Commands);
            Assert.IsTrue(firstHeaderViewModel.Commands.Any());
        }
        private HorizontalListLayout FindHorizontalList(HorizontalListLayout root, Predicate <HorizontalListLayout> predicate)
        {
            if (root == null)
            {
                return(null);
            }

            if (predicate(root))
            {
                return(root);
            }

            return(FindHorizontalList(root.Next, predicate));
        }
        protected override void Arrange()
        {
            base.Arrange();

            var deepestRule = ValidationViewModel.DescendentConfigurationsOfType <AndCompositeValidatorData>()
                              .Where(x => string.Equals(x.NameProperty.Value, DeepestRuleValidatorName)).First();

            ruleCollection = (ElementCollectionViewModel)deepestRule.ParentElement;

            walker = new ElementListLayoutWalker(Layout.Contained);
            var currentDeepestLayout = walker.LayoutElements().OfType <TwoColumnsLayout>().Where(l => l.Left == deepestRule).First();

            layoutHeader            = FindHorizontalList(currentDeepestLayout.ColumnName);
            propertyChangedListener = new PropertyChangedListener(layoutHeader);
        }
 protected override void Arrange()
 {
     base.Arrange();
     Layout = (HorizontalListLayout)ValidationViewModel.Bindable;
 }