Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
            }
        }