static void OnTickLabelFontFamilyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { VolumeTicksElement thisElement = obj as VolumeTicksElement; if (thisElement == null) { return; } thisElement.currentTypeFace = new Typeface(thisElement.TickLabelFontFamily.ToString()); }
private static object CoerceAxisTickColor(DependencyObject objWithOldDP, object newDPValue) { VolumeTicksElement thisElement = (VolumeTicksElement)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); } }