Issue in WinUI TextBox style when overriding

guess_me_if_u_can 126 Reputation points
2021-12-01T17:07:21.693+00:00

I have tried to override the default textbox style. By default, textbox style has corner radius and thicker accent line when cursor is on focus. By when i try to override the style, even if i haven't changed any property, the textbox losses its corner radius and the accent line on focus gets thinner. Is this an issue or Am I missing anything?

default style:
154087-image.png

overridden style:
154168-image.png

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
784 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 84,956 Reputation points
    2021-12-02T10:39:06.49+00:00

    To keep existing style properties, you must add :

     BasedOn="{StaticResource DefaultTextBoxStyle}"
    

1 additional answer

Sort by: Most helpful
  1. Castorix31 84,956 Reputation points
    2021-12-01T18:35:04.383+00:00

    You must add x:Key, like in the doc :

     <Style TargetType="TextBox" x:Key="TextBoxStyle">
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.