private HorizontalListLayout(IEnumerable<ViewModel> elements, int nestingDepth, HorizontalListLayout root, IElementChangeScope changeScope)
        {
            this.nestingDepth = nestingDepth;

            this.current = elements.First();
            this.hasNext = elements.Count() > 1;
            this.elements = elements;

            rootListLayout = root ?? this;

            OwnsResizing = true;

            this.changeScope = changeScope;
            if (this.changeScope != null)
            {
                this.changeScope.CollectionChanged += ForcePropertyRequery;
            }
        }
Beispiel #2
0
        private HorizontalListLayout(IEnumerable <ViewModel> elements, int nestingDepth, HorizontalListLayout root, IElementChangeScope changeScope)
        {
            this.nestingDepth = nestingDepth;

            this.current  = elements.First();
            this.hasNext  = elements.Count() > 1;
            this.elements = elements;

            rootListLayout = root ?? this;

            OwnsResizing = true;

            this.changeScope = changeScope;
            if (this.changeScope != null)
            {
                this.changeScope.CollectionChanged += ForcePropertyRequery;
            }
        }
        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();
     Layout = (HorizontalListLayout)ValidationViewModel.Bindable;
 }
        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);
        }