Skip to content

Problem with UNO style in MainPage.xaml #18914

Closed Answered by Xiaoy312
ward-horsfall asked this question in Q&A
Discussion options

You must be logged in to vote

This may seems counter-intuitive, but you actually need to specify the Style.BasedOn when attempt to override it. This is not only the case for Uno, but for WinAppSdk as well:

This should fix the problem you are encounting:

<Style TargetType="TextBox" x:Key="UniformTextBoxStyle" BasedOn="{StaticResource MaterialOutlinedTextBoxStyle}">

You can find the x:Key of the default style for the Material theme here:
https://platform.uno/docs/articles/external/uno.themes/doc/lightweight-styling.html#resource-keys

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ward-horsfall
Comment options

Answer selected by ward-horsfall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants