Пример #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());
        }
Пример #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());
            }
        }
Пример #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);
            }
        }