protected override void OnVisualTreeChanged(AbcVisualTree oldVisualTree)
        {
            base.OnVisualTreeChanged(oldVisualTree);

            if (oldVisualTree != null)
            {
                this.ticksPool.Clear();
                this.ticksPool = null;
                this.labelsPool.Clear();
                this.labelsPool = null;
                this.canvas.Children.Clear();
                this.Canvas   = null;
                this.axisLine = null;
            }

            if (this.VisualTree != null)
            {
                this.Canvas = (IAbcCanvas)this.VisualTree.CreateVisual(typeof(IAbcCanvas));
                this.Canvas.SetContextualPropertyValue(AbcControlContextualProperties.ControlPropertyKey, new AbcContextualPropertyValue.AbcObject {
                    value = this
                });
                this.ticksPool  = new AbcVisualsPool <IAbcRectangle>(this.Canvas, this.CreateTick);
                this.labelsPool = new AbcVisualsPool <IAbcLabel>(this.Canvas, this.CreateLabel);
            }
        }
Exemple #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);
            }
        }
Exemple #3
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);
        }
Exemple #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;

                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);
        }
Exemple #5
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);
        }