Ejemplo n.º 1
0
        static void OnTickLabelFontFamilyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            PriceTicksElement thisElement = obj as PriceTicksElement;

            if (thisElement == null)
            {
                return;
            }
            thisElement.currentTypeFace = new Typeface(thisElement.TickLabelFontFamily.ToString());
        }
Ejemplo n.º 2
0
        private static object CoerceCurrentPriceLabelBackground(DependencyObject objWithOldDP, object newDPValue)
        {
            PriceTicksElement thisElement   = (PriceTicksElement)objWithOldDP;
            Brush             newBrushValue = (Brush)newDPValue;

            if (newBrushValue.IsFrozen)
            {
                return(newDPValue);
            }
            else
            {
                return((Brush)newBrushValue.GetCurrentValueAsFrozen());
            }
        }
Ejemplo n.º 3
0
        private static object CoerceTickColor(DependencyObject objWithOldDP, object newDPValue)
        {
            PriceTicksElement thisElement   = (PriceTicksElement)objWithOldDP;
            Brush             newBrushValue = (Brush)newDPValue;

            if (newBrushValue.IsFrozen)
            {
                Pen p = new Pen(newBrushValue, 1.0);
                p.Freeze();
                thisElement.tickPen = p;
                return(newDPValue);
            }
            else
            {
                Brush b = (Brush)newBrushValue.GetCurrentValueAsFrozen();
                Pen   p = new Pen(b, 1.0);
                p.Freeze();
                thisElement.tickPen = p;
                return(b);
            }
        }