public void Dispose() { owner.updateOnCommonChange = true; bool shouldUpdate = owner.range != prevRange; var screenRect = owner.Transform.ScreenRect; if (prevTransform != null) { 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; } else { shouldUpdate = true; } shouldUpdate |= forceUpdate; if (shouldUpdate) { owner.UpdateUI(); } owner = null; }
/// <summary> /// Initializes a new instance of the <see cref="AxisBase<T>"/> 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; axisControl.SetBinding(Control.BackgroundProperty, new Binding("Background") { Source = this }); Focusable = false; Loaded += OnLoaded; }
public UpdateRegionHolder(AxisControl <TT> owner, bool forceUpdate) { this.owner = owner; owner.updateOnCommonChange = false; prevTransform = owner.transform; prevRange = owner.range; this.forceUpdate = forceUpdate; }
/// <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 }); }
public UpdateRegionHolder(AxisControl <TT> owner) : this(owner, false) { }