private static void maxLengthChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { TruncatedTextBlock input = (TruncatedTextBlock)d; maxLength = int.Parse(e.NewValue.ToString()); SetValues(displayText, maxLength, input); }
private static void displayTextChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { TruncatedTextBlock input = (TruncatedTextBlock)d; displayText = e.NewValue as string; SetValues(displayText, maxLength, input); }
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; }
private static void isCollapsedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { TruncatedTextBlock input = (TruncatedTextBlock)d; //input.tbTest.Text = e.NewValue as string; }
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; }