custom property editor

Grids for WPF Forum

Posted 8 years ago by Mary Fontana - Rudolph Technologies
Avatar
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>

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mary,

You would have to build a custom IValueConverter and use that in your Binding. The converter would take the first line of test and/or trim as needed.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.