Search code examples
wpfvalidationlistboxstylesdefault

Is it possible to override default style of ListBox validation in themes.xaml


I tried to change the default style for ListBox validation in my themes.xaml file but don't know how. I hope can help me


Solution

  • There is no need to use Themes.xaml to override a default Style in WPF. You can do it quite simply using an ordinary Style in any Resources section:

    <Style TargetType="{x:Type ListBox}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <!-- Your Style Setters here -->
    </Style>