Exemplo n.º 1
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.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;
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     owner.updateOnCommonChange = true;
     owner.UpdateUIRepresentation();
     owner = null;
 }
Exemplo n.º 3
0
 public UpdateRegionHolder(AxisControl <TT> owner)
 {
     this.owner = owner;
     owner.updateOnCommonChange = false;
 }