I have a ListBox
which consists from items like this:
<ListBoxItem>
<ListBoxItem.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=department}"></TextBlock>
</DataTemplate>
</ListBoxItem.ContentTemplate>
</ListBoxItem>
department is a string property :text="dept1\dept2\dept3\dept4\dept5\dept6"
My problem is that when ListBox
size is changing I want to change the TextBlock
text in this way: text= dept1\dept2\...\dept6.
the length of (dept1\dept2\...\dept6) is equal or less than ListBoxItem
actual size.