Esempio n. 1
0
            public void Dispose()
            {
                owner.updateOnCommonChange = true;

                bool shouldUpdate = owner.range != prevRange;

                var screenRect     = owner.Transform.ScreenRect;
                var prevScreenRect = prevTransform.ScreenRect;

                if (owner.placement.IsBottomOrTop())
                {
                    shouldUpdate |= prevScreenRect.Width != screenRect.Width;
                }
                else
                {
                    shouldUpdate |= prevScreenRect.Height != screenRect.Height;
                }

                shouldUpdate |= owner.transform.DataTransform != prevTransform.DataTransform;
                shouldUpdate |= forceUpdate;

                if (shouldUpdate)
                {
                    owner.UpdateUI();
                }
                owner = null;
            }
        /// <summary>
        /// Initializes a new instance of the <see cref="AxisBase&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="axisControl">The axis control.</param>
        /// <param name="convertFromDouble">The convert from double.</param>
        /// <param name="convertToDouble">The convert to double.</param>
        protected AxisBase(AxisControl <T> axisControl, Func <double, T> convertFromDouble, Func <T, double> convertToDouble)
        {
            if (axisControl == null)
            {
                throw new ArgumentNullException("axisControl");
            }
            if (convertFromDouble == null)
            {
                throw new ArgumentNullException("convertFromDouble");
            }
            if (convertToDouble == null)
            {
                throw new ArgumentNullException("convertToDouble");
            }

            this.convertToDouble   = convertToDouble;
            this.convertFromDouble = convertFromDouble;

            this.axisControl = axisControl;
            axisControl.MakeDependent();
            axisControl.ConvertToDouble     = convertToDouble;
            axisControl.ScreenTicksChanged += axisControl_ScreenTicksChanged;

            Content = axisControl;
            Binding binding = new Binding("Background");

            binding.Source = this;
            axisControl.SetBinding(Control.BackgroundProperty, binding);

            Loaded += OnLoaded;
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AxisBase&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="axisControl">The axis control.</param>
        /// <param name="convertFromDouble">The convert from double.</param>
        /// <param name="convertToDouble">The convert to double.</param>
        protected AxisBase(AxisControl <T> axisControl, Func <double, T> convertFromDouble, Func <T, double> convertToDouble)
        {
            if (axisControl == null)
            {
                throw new ArgumentNullException("axisControl");
            }
            if (convertFromDouble == null)
            {
                throw new ArgumentNullException("convertFromDouble");
            }
            if (convertToDouble == null)
            {
                throw new ArgumentNullException("convertToDouble");
            }

            this.convertToDouble   = convertToDouble;
            this.convertFromDouble = convertFromDouble;

            this.axisControl            = axisControl;
            axisControl.ConvertToDouble = convertToDouble;

            Content = axisControl;
            Binding binding = new Binding("Background");

            binding.Source = this;
            axisControl.SetBinding(Control.BackgroundProperty, binding);
            Loaded += OnLoaded;
            axisControl.loadedPartsChanged += new EventHandler(axisControl_loadedPartsChanged);
        }
Esempio n. 4
0
            public UpdateRegionHolder(AxisControl <TT> owner, bool forceUpdate)
            {
                this.owner = owner;
                owner.updateOnCommonChange = false;

                prevTransform    = owner.transform;
                prevRange        = owner.range;
                this.forceUpdate = forceUpdate;
            }
Esempio n. 5
0
 public void Dispose()
 {
     owner.updateOnCommonChange = true;
     if (owner.range != prevRange ||
         owner.transform.ScreenRect != prevTransform.ScreenRect ||
         owner.transform.DataTransform != prevTransform.DataTransform ||
         forceUpdate)
     {
         owner.UpdateUIRepresentation();
     }
     owner = null;
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DateTimeAxis"/> class.
 /// </summary>
 public DateTimeAxis()
     : base(new DateTimeAxisControl(), DoubleToDate,
            dt => dt.Ticks / 10000000000.0)
 {
     AxisControl.SetBinding(MajorLabelBackgroundBrushProperty, new Binding("MajorLabelBackgroundBrush")
     {
         Source = this
     });
     AxisControl.SetBinding(MajorLabelRectangleBorderPropertyProperty, new Binding("MajorLabelRectangleBorderProperty")
     {
         Source = this
     });
 }
Esempio n. 7
0
 public void Dispose()
 {
     owner.updateOnCommonChange = true;
     owner.UpdateUIRepresentation();
     owner = null;
 }
Esempio n. 8
0
 public UpdateRegionHolder(AxisControl <TT> owner)
 {
     this.owner = owner;
     owner.updateOnCommonChange = false;
 }
Esempio n. 9
0
 public UpdateRegionHolder(AxisControl <TT> owner) : this(owner, false)
 {
 }