I want to customize TextBlock control to remove its ellipses(three dots at end) for TextTrimming="WordEllipsis". But since TextBlock does not have template property I cannot customize its trimming ellipses. Is there a way to remove those dots in case ellipses shown?
there is no official way to do this. what you could do is abuse TextWrapping property instead.
Remove the trimming and set TextWrappping to WrapWholeWords this will move all remaining text to a next line. if you combine this with a MaxHeight that you hard code to the height of 1 line it should get the same effect.
<TextBlock TextWrapping="WrapWholeWords" MaxHeight="30">
Related
I have a textbox that I write info to that automatically creates a scroll bar when the screen is filled, and I'd like to scroll to the bottom of it. It seems like what I need to do is set the scrollbar Offset to some vector, but my problem is finding the ScrollViewer.
I can't use FindControl because it's not named anywhere in the xaml, and I can only change a few values using textbox.SetValue
The only way to scroll a TextBox currently is to set the CaretPosition. For example to scroll to the end of the text you could use:
textbox.CaretIndex = int.MaxValue;
For me it works only when I set textbox.CaretIndex to the length of the text. Assuming that property Logs (string type) is binded to textbox I used this
textbox.CaretIndex = Logs.Length
I have a Silverlight application and I use MVVM.
I would like to display or hide a TextBlock, based on another element current width (or window width at least...). The problem is that I currently have 2 texts on each other if I reduce the width of my window so I need want to hide the second textblock in that case...
I'm a beginner and I know how to use a VisibilityConverter with a boolean from my ViewModel, but not like this...
To bind to a property of another element, you would do something like this:
Visibility="{Binding ActualWidth,
ElementName=TheThingWhoseWidthYouAreBindingTo,
Converter={StaticResource WidthToVisibilityConverter}}"
And then create yourself a WidthToVisibilityConverter that takes the width value and returns a Visibility value.
The best way to describe the problem is trough the following image
It's very anti-estetic, can i limit the width of the label box, while forcing the text to spread in lines below?
Yes you have to set the Autosize property of the RadioButton to false and resize the control. The text will spread over multiple lines.
Alternatively you can insert "\n" in the text - works only at run-time
I'm using the LongListMultiSelector of the WP Toolkit to select multiple items. I've written a DataTemplate, which is a little bit complex and have a hight of round about 140px. Now I want to change the position of the Checkbox to VerticalAlignment Top to VerticalAlignment Center. I've tried to change the style of the LongListMultiSelector, but this doesn't work.
Has anybody an idea?
It's the LongListMultiSelector's ItemContainerStyle. Here you find the toolkit's styles. Copy the < Style x:Key="LongListMultiSelectorItemListStyle" TargetType="controls:LongListMultiSelectorItem">, change the x:Key, and change the line which says < CheckBox x:Name="SelectBox" VerticalAlignment="Top" ...
how can I create some blank space at the end of a LongListSelector. When I scroll to the very end I am unable to clearly read the last item.
When I use margin the LLS automatically gets smaller. So that does not suite it.
Image
Use an empty control as ListFooter. For example:
<phone:LongListSelector.ListFooter>
<StackPanel Height="50"></StackPanel>
</phone:LongListSelector.ListFooter>