Hi,
I'm using XamPropertyGrid for Showing the Properties of an Selected object.
when the Property Value has length more than the visual the Wrapping is not done and Cursor moves out of focus loosing the view of What text is being entered.
i tried to use following Trigger but still its not Acheived
<Style TargetType="{x:Type igEditors:XamTextEditor}">
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
Hi Santhosh -
The best way to achieve this without interfering with the xamPropertyGrid's styling and Themes is to use the property grid's EditorDefinition feature to define a simple editor for properties of type string:
<igEditors:XamPropertyGrid>
<igEditors:XamPropertyGrid.EditorDefinitions>
<igEditors:PropertyGridEditorDefinition TargetType="{x:Type sys:String}">
<igEditors:PropertyGridEditorDefinition.EditTemplate>
<DataTemplate>
<TextBox TextWrapping="Wrap" Text="{Binding EditorValue}"/>
</DataTemplate>
</igEditors:PropertyGridEditorDefinition.EditTemplate>
</igEditors:PropertyGridEditorDefinition>
</igEditors:XamPropertyGrid.EditorDefinitions>
</igEditors:XamPropertyGrid>
Note that you could also specify a list of specific property names within the EditorDefinition if you only wanted a subset of all string properties:
<ig:PropertyGridEditorDefinition.TargetProperties>
<sys:String>StringProp1</sys:String>
<sys:String>StringProp2</sys:String>
</ig:PropertyGridEditorDefinition.TargetProperties>
BTW - the above code assumes that there is an xmlns namespace declaration somewhere in your XAML for the prefix 'sys' as shown here:
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Hope this helps.
Joe