private static void OnTickLabelFontSizeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeTicksElement thisElement = (TimeTicksElement)obj; thisElement.ReCalc_TickLabelWidths(); thisElement.ReCalc_TimeTicksTimeFrame(); }
private static void OnTimeTickFontSizeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeTicksElement thisElement = (TimeTicksElement)obj; thisElement.Time_TickWidth = thisElement.Calc_Time_TickWidth(thisElement.TimeTickFontSize); thisElement.DayOrMonthOrYear_TickWidth = thisElement.Calc_DayOrMonthOrYear_TickWidth(thisElement.TimeTickFontSize); thisElement.Day_TickWidth = thisElement.Calc_Day_TickWidth(thisElement.TimeTickFontSize); thisElement.ReCalc_TimeTicksTimeFrame(); }
static void OnTickLabelFontFamilyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeTicksElement thisElement = obj as TimeTicksElement; if (thisElement == null) { return; } thisElement.currentTypeFace = new Typeface(thisElement.TickLabelFontFamily.ToString()); }
private static void OnCandlesSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeTicksElement thisElement = (TimeTicksElement)obj; thisElement.ReCalc_TimeTicksTimeFrame(); if (e.OldValue != null && e.OldValue is INotifyCollectionChanged) { (e.OldValue as INotifyCollectionChanged).CollectionChanged -= thisElement.OnCandlesSourceCollectionChanged; } if (e.NewValue != null && e.NewValue is INotifyCollectionChanged) { (e.NewValue as INotifyCollectionChanged).CollectionChanged += thisElement.OnCandlesSourceCollectionChanged; } }
private static object CoerceAxisTickColor(DependencyObject objWithOldDP, object newDPValue) { TimeTicksElement thisElement = (TimeTicksElement)objWithOldDP; Brush newBrushValue = (Brush)newDPValue; if (newBrushValue.IsFrozen) { Pen p = new Pen(newBrushValue, 1.0); p.Freeze(); thisElement.axisTickPen = p; return(newDPValue); } else { Brush b = (Brush)newBrushValue.GetCurrentValueAsFrozen(); Pen p = new Pen(b, 1.0); p.Freeze(); thisElement.axisTickPen = p; return(b); } }
private static void OnCandlesSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeTicksElement thisElement = (TimeTicksElement)obj; thisElement.ReCalc_TimeTicksTimeFrame(); }