Пример #1
0
        private static void OnTextBrushPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText rtext = d as RaisedText;
            Brush      brush = e.NewValue as Brush;

            rtext.DisplayText.Foreground = brush;
        }
Пример #2
0
        private static void OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText rtext = d as RaisedText;
            string     text  = (string)e.NewValue;

            rtext.DisplayText.Text     = text;
            rtext.DisplayTextBlur.Text = text;
        }
Пример #3
0
        private static void OnShadowDirectionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText       rtext     = d as RaisedText;
            double           direction = (double)e.NewValue;
            DropShadowEffect effect    = rtext.DisplayText.Effect as DropShadowEffect;

            effect.Direction = direction;
        }
Пример #4
0
        private static void OnShadowOpacityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText       rtext   = d as RaisedText;
            double           opacity = (double)e.NewValue;
            DropShadowEffect effect  = rtext.DisplayText.Effect as DropShadowEffect;

            effect.Opacity = opacity;
        }
Пример #5
0
        private static void OnShadowColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText       rtext  = d as RaisedText;
            Color            color  = (Color)e.NewValue;
            DropShadowEffect effect = rtext.DisplayText.Effect as DropShadowEffect;

            effect.Color = color;
        }
Пример #6
0
        private static void OnShadowBlurRadiusPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText       rtext  = d as RaisedText;
            double           radius = (double)e.NewValue;
            DropShadowEffect effect = rtext.DisplayText.Effect as DropShadowEffect;

            effect.BlurRadius = radius;
        }
Пример #7
0
        private static void OnTextWrappingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText   rtext = d as RaisedText;
            TextWrapping wrap  = (TextWrapping)e.NewValue;

            rtext.DisplayText.TextWrapping     = wrap;
            rtext.DisplayTextBlur.TextWrapping = wrap;
        }
Пример #8
0
        private static void OnTextAlignmentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText    rtext = d as RaisedText;
            TextAlignment align = (TextAlignment)e.NewValue;

            rtext.DisplayText.TextAlignment     = align;
            rtext.DisplayTextBlur.TextAlignment = align;
        }
Пример #9
0
        private static void OnTextWeightPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText rtext  = d as RaisedText;
            FontWeight weight = (FontWeight)e.NewValue;

            rtext.DisplayText.FontWeight     = weight;
            rtext.DisplayTextBlur.FontWeight = weight;
        }
Пример #10
0
        private static void OnTextStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText rtext = d as RaisedText;
            FontStyle  style = (FontStyle)e.NewValue;

            rtext.DisplayText.FontStyle     = style;
            rtext.DisplayTextBlur.FontStyle = style;
        }
Пример #11
0
        private static void OnTextFamilyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText rtext = d as RaisedText;
            FontFamily font  = (FontFamily)e.NewValue;

            rtext.DisplayText.FontFamily     = font;
            rtext.DisplayTextBlur.FontFamily = font;
        }
Пример #12
0
        private static void OnTextSizePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RaisedText rtext = d as RaisedText;

            if (!double.IsNaN((double)e.NewValue))
            {
                double size = (double)e.NewValue;
                rtext.DisplayText.FontSize     = size;
                rtext.DisplayTextBlur.FontSize = size;
            }
        }