Ejemplo n.º 1
0
        private static void maxLengthChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TruncatedTextBlock input = (TruncatedTextBlock)d;

            maxLength = int.Parse(e.NewValue.ToString());
            SetValues(displayText, maxLength, input);
        }
Ejemplo n.º 2
0
        private static void displayTextChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TruncatedTextBlock input = (TruncatedTextBlock)d;

            displayText = e.NewValue as string;
            SetValues(displayText, maxLength, input);
        }
Ejemplo n.º 3
0
        private static void SetValues(string text, int length, TruncatedTextBlock input)
        {
            Console.Write("");

            string newText = text;

            if (newText.Length > length && length > 0)
            {
                newText = newText.Substring(0, length) + " ...";
            }

            input.txtTText.Text     = newText;
            input.txtTTextFull.Text = text;
        }
Ejemplo n.º 4
0
 private static void isCollapsedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     TruncatedTextBlock input = (TruncatedTextBlock)d;
     //input.tbTest.Text = e.NewValue as string;
 }
Ejemplo n.º 5
0
		private static void SetValues(string text, int length, TruncatedTextBlock input)
		{
			Console.Write("");

			string newText = text;
			if (newText.Length > length && length > 0)
			{
				newText = newText.Substring(0, length) + " ...";
			}

			input.txtTText.Text = newText;
			input.txtTTextFull.Text = text;
		}