Skip to main content

How to: Customize the Appearance of a Standalone Editor

The following code sample customizes the visual appearance of a standalone editor:

WPF TextEdit - EditTemplate Example

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys"
    xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal">
    <dxe:TextEdit Width="130" HorizontalAlignment="Center"
                  VerticalAlignment="Center" EditValue="USA" ShowBorder="False">
        <dxe:TextEdit.EditTemplate>
            <ControlTemplate>
                <Border BorderBrush="Orange" BorderThickness="3" CornerRadius="7">
                    <DockPanel>
                        <TextBlock Margin="2" VerticalAlignment="Center" Foreground="Gray" Text="Country:" />
                        <TextBox Name="PART_Editor" Margin="2"
                                 Style="{dxi:ThemeResource {dxet:TextEditThemeKey ResourceKey=TextStyle}}" />
                    </DockPanel>
                </Border>
            </ControlTemplate>
        </dxe:TextEdit.EditTemplate>
    </dxe:TextEdit>
</Window>

Refer to the following help topic for more information: Modify Theme Resources.