AbcContextualPropertyValue IAbcVisual.GetContextualPropertyValue(AbcContextualPropertyKey propertyKey) { AbcContextualPropertyValue propertyValue = null; this.contextualProperties?.TryGetValue(propertyKey.key, out propertyValue); return(propertyValue); }
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); } }
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); } }
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); }
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)); }
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); }
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; }