Search code examples
wpfxamldevexpressdevexpress-wpf

Apply default ControlTemplate to only one Control


I have modified the ControlTemplate for ComboBoxEdit like this (in App.xaml):

<ControlTemplate x:Key="CustomComboBoxEditTemplate" TargetType="{x:Type dxe:ButtonEdit}">
           ...
</ControlTemplate>
<Style TargetType="{x:Type dxe:ComboBoxEdit}">
   <Setter Property="Template" Value="{StaticResource CustomComboBoxEditTemplate}"/>
</Style>

For 1 Control in I need the original. How can I set the original template for only 1 control?

<dxe:ComboBoxEdit Name="PART_Editor" ItemsSource="{Binding ...}"
   Template="What can I write here?">
</dxe:ComboBoxEdit>

Solution

  • You could set the Style property to {x:Null} to use the default style:

    <dxe:ComboBoxEdit Name="PART_Editor" ItemsSource="{Binding ...}" Style="{x:Null}" />
    

    Of course this assumes that the control actually has a default style.