Hi people,
I'm trying to make a template for a textbox, but it is strange behavior. See this xaml code.
This code Works:
<Page.Resources>
<Style TargetType="TextBox">
<Setter Property="Height" Value="80" />
<Setter Property="Foreground" Value="White" />
</Style>
<ControlTemplate TargetType="TextBox" x:Key="bordaTexto">
<Border CornerRadius="5" BorderBrush="#FF2B6789" BorderThickness="4">
<TextBox />
</Border>
</ControlTemplate>
</Page.Resources>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<TextBox Text="teste1" HorizontalAlignment="Left" Margin="23,157,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="349" Template="{StaticResource
bordaTexto}"/>
<TextBox Text="teste2" HorizontalAlignment="Left" Margin="411,157,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="349" Template="{StaticResource
bordaTexto}"/>
</Grid>
This code doesn't work(difference is element <TextBox /> inside <Border>):
<Page.Resources>
<Style TargetType="TextBox">
<Setter Property="Height" Value="80" />
<Setter Property="Foreground" Value="White" />
</Style>
<ControlTemplate TargetType="TextBox" x:Key="bordaTexto">
<Border CornerRadius="5" BorderBrush="#FF2B6789" BorderThickness="4">
</Border>
</ControlTemplate>
</Page.Resources>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<TextBox Text="teste1" HorizontalAlignment="Left" Margin="23,157,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="349" Template="{StaticResource
bordaTexto}"/>
<TextBox Text="teste2" HorizontalAlignment="Left" Margin="411,157,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="349" Template="{StaticResource
bordaTexto}"/>
</Grid>
Thanks...