Example #1
0
        static void OnTextPathPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TextOnAPath textOnAPath = d as TextOnAPath;

            if (textOnAPath == null)
            {
                return;
            }

            if (e.NewValue == e.OldValue || e.NewValue == null)
            {
                return;
            }

            textOnAPath.TextPath.Transform = null;

            textOnAPath.UpdateSize();
            textOnAPath.Update();
        }
Example #2
0
        static void OnScaleTextPathPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TextOnAPath textOnAPath = d as TextOnAPath;

            if (textOnAPath == null)
            {
                return;
            }

            if (e.NewValue == e.OldValue)
            {
                return;
            }

            bool value = (Boolean)e.NewValue;

            if (value == false && textOnAPath.TextPath != null)
            {
                textOnAPath.TextPath.Transform = null;
            }

            textOnAPath.UpdateSize();
            textOnAPath.Update();
        }