I'm trying to make a uwp application with dark theme.
But after I change the theme from light to dark, when I type in the textbox, the background of the textbox is white, rather than black.
So how can I change the background of the textbox when the textbox is in edit mode?
The codes of mine which takes no effect:
<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border Name="TextBoxBorder" CornerRadius="10" BorderThickness="2" BorderBrush="Gray">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="Normal" />
<VisualState x:Name="Focused">
<VisualState.Setters>
<Setter Target="TextBox.Background" Value="Black" />
<Setter Target="TextBox.Foreground" Value="White" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<TextBox x:Name="TextBox" BorderThickness="0" BorderBrush="Transparent"
Background="Transparent"
Margin="2"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
When I start to type in the textbox of my app, the background is white.
When I start to type in the textbox of System App -- Mail, the background remains black.