示例#1
0
        private static void TextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Running_Text s = d as Running_Text;

            s.Text = (string)e.NewValue;
            s.text = s.Text;
            if (s.text.Length > ((int)s.Width / 7))
            {
                s.MainText.Text = s.text.Substring(0, ((int)s.Width / 7) - 3) + "...";
            }
            else
            {
                s.MainText.Text = s.text;
            }
        }
示例#2
0
        private static void ForegroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Running_Text s = d as Running_Text;

            s.MainText.Foreground = s.TextForeground;
        }