Posted 14 years ago
by Mary Fontana
-
Rudolph Technologies
I created a custom property editor that uses the AnimatedExpander to display the text string. So it will expand to display multi line text.
I would like the header to just show just the first line of this text.
Is there anyway I could do this in the xaml header binding below? Get a substring of of text - first line of text for the header.
I tested below with no header specified and it works fine. Now I would like header to show first line of text. This works but shows entire text in header.
<shared:AnimatedExpander ExpandDirection="Down" Header="{Binding ElementName=textBox, Path=Text}">
<TextBox x:Name="textBox" Margin="0" Padding="0" BorderThickness="0" Background="Transparent" MinLines="1" AcceptsReturn="True"
Text="{Binding ValueAsString, RelativeSource={RelativeSource AncestorType={x:Type propgridPrimitives:IPropertyDataAccessor}}, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Converter={StaticResource NoOpConverter}}" />
</shared:AnimatedExpander>
I would like the header to just show just the first line of this text.
Is there anyway I could do this in the xaml header binding below? Get a substring of of text - first line of text for the header.
I tested below with no header specified and it works fine. Now I would like header to show first line of text. This works but shows entire text in header.
<shared:AnimatedExpander ExpandDirection="Down" Header="{Binding ElementName=textBox, Path=Text}">
<TextBox x:Name="textBox" Margin="0" Padding="0" BorderThickness="0" Background="Transparent" MinLines="1" AcceptsReturn="True"
Text="{Binding ValueAsString, RelativeSource={RelativeSource AncestorType={x:Type propgridPrimitives:IPropertyDataAccessor}}, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Converter={StaticResource NoOpConverter}}" />
</shared:AnimatedExpander>