示例#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;
 }