Пример #1
0
        AbcContextualPropertyValue IAbcVisual.GetContextualPropertyValue(AbcContextualPropertyKey propertyKey)
        {
            AbcContextualPropertyValue propertyValue = null;

            this.contextualProperties?.TryGetValue(propertyKey.key, out propertyValue);
            return(propertyValue);
        }
Пример #2
0
        internal override void ArrangeOverride(AbcArrangeContext context)
        {
            IAbcCanvas abcCanvas = this;

            foreach (IAbcVisual child in abcCanvas.Children)
            {
                AbcContextualPropertyValue arrangeSlotPropertyValue = child.GetContextualPropertyValue(AbcCanvasContextualProperties.ArrangeSlotPropertyKey);
                context.arrangeSlot = arrangeSlotPropertyValue != null ? ((AbcContextualPropertyValue.AbcRect)arrangeSlotPropertyValue).value : abcCanvas.ArrangeSlot;
                child.Arrange(context);
            }
        }
Пример #3
0
 private void PropagateUpInvalidationRequest(InvalidationRequestFlag flag)
 {
     if (this.visualParent != null)
     {
         this.visualParent.InvalidationRequestFromChild(flag, this);
     }
     else
     {
         IAbcVisual abcVisual = this;
         AbcContextualPropertyValue controlPropertyValue = abcVisual.GetContextualPropertyValue(AbcControlContextualProperties.ControlPropertyKey);
         IAbcControl control = (IAbcControl)(controlPropertyValue != null ? ((AbcContextualPropertyValue.AbcObject)controlPropertyValue).value : null);
         control?.RaiseInvalidationRequest(flag);
     }
 }
Пример #4
0
        internal override void ArrangeOverride(AbcArrangeContext context)
        {
            IAbcCanvas abcCanvas = this;

            foreach (IAbcVisual abcChild in abcCanvas.Children)
            {
                AbcContextualPropertyValue arrangeSlotPropertyValue = abcChild.GetContextualPropertyValue(AbcCanvasContextualProperties.ArrangeSlotPropertyKey);
                context.arrangeSlot = arrangeSlotPropertyValue != null ? ((AbcContextualPropertyValue.AbcRect)arrangeSlotPropertyValue).value : abcCanvas.ArrangeSlot;

                WpfVisual        wpfVisual        = (WpfVisual)abcChild;
                FrameworkElement frameworkElement = (FrameworkElement)wpfVisual.uiElement;
                SlotPanel.SetSlot(frameworkElement, Utils.ToRect(context.arrangeSlot));

                abcChild.Arrange(context);
            }

            base.ArrangeOverride(context);
        }
Пример #5
0
        void IAbcVisual.SetContextualPropertyValue(AbcContextualPropertyKey propertyKey, AbcContextualPropertyValue propertyValue)
        {
            if (this.contextualProperties == null)
            {
                this.contextualProperties = new Dictionary <int, AbcContextualPropertyValue>();
            }

            EventHandler <AbcContextualPropertyValueChangedEventArgs> propertyChanged = this.contextualPropertyValueChanged;
            AbcContextualPropertyValue oldPropertyValue = null;

            if (propertyChanged != null)
            {
                this.contextualProperties.TryGetValue(propertyKey.key, out oldPropertyValue);
            }

            this.contextualProperties[propertyKey.key] = propertyValue;
            propertyChanged?.Invoke(this, new AbcContextualPropertyValueChangedEventArgs(propertyKey, oldPropertyValue, propertyValue));
        }
Пример #6
0
        internal override void ArrangeOverride(AbcArrangeContext context)
        {
            IAbcCanvas abcCanvas = this;

            foreach (IAbcVisual abcChild in abcCanvas.Children)
            {
                AbcContextualPropertyValue arrangeSlotPropertyValue = abcChild.GetContextualPropertyValue(AbcCanvasContextualProperties.ArrangeSlotPropertyKey);
                context.arrangeSlot = arrangeSlotPropertyValue != null ? ((AbcContextualPropertyValue.AbcRect)arrangeSlotPropertyValue).value : abcCanvas.ArrangeSlot;

                var androidVisual = (AndroidVisual)abcChild;
                var slotView      = androidVisual.view as IAbcAndroidSlotView;
                if (slotView != null)
                {
                    slotView.Slot = new Rect((int)context.arrangeSlot.x, (int)context.arrangeSlot.y, (int)context.arrangeSlot.Right(), (int)context.arrangeSlot.Bottom());
                }

                abcChild.Arrange(context);
            }

            base.ArrangeOverride(context);
        }
Пример #7
0
        internal override void ArrangeOverride(AbcArrangeContext context)
        {
            IAbcCanvas abcCanvas = this;

            foreach (IAbcVisual abcChild in abcCanvas.Children)
            {
                AbcContextualPropertyValue arrangeSlotPropertyValue = abcChild.GetContextualPropertyValue(AbcCanvasContextualProperties.ArrangeSlotPropertyKey);
                context.arrangeSlot = arrangeSlotPropertyValue != null ? ((AbcContextualPropertyValue.AbcRect)arrangeSlotPropertyValue).value : abcCanvas.ArrangeSlot;

                WFVisual wfVisual      = (WFVisual)abcChild;
                Control  visualControl = (Control)wfVisual.control;

                if (visualControl != null)
                {
                    visualControl.Bounds = new Rectangle((int)context.arrangeSlot.x, (int)context.arrangeSlot.y, (int)context.arrangeSlot.size.width, (int)context.arrangeSlot.size.height);
                }

                abcChild.Arrange(context);
            }

            base.ArrangeOverride(context);
        }
 public AbcContextualPropertyValueChangedEventArgs(AbcContextualPropertyKey propertyKey, AbcContextualPropertyValue oldPropertyValue, AbcContextualPropertyValue newPropertyValue)
 {
     this.propertyKey      = propertyKey;
     this.oldPropertyValue = oldPropertyValue;
     this.newPropertyValue = newPropertyValue;
 }