RoundCornerTextBoxStyle.xaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style TargetType="TextBox" x:Key="RoundCornerTextBox">
  4. <Setter Property="Height" Value="36"/>
  5. <Setter Property="FontSize" Value="14"/>
  6. <Setter Property="Padding" Value="10,0,15,0"/>
  7. <Setter Property="Background" Value="Transparent"></Setter>
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="TextBox">
  11. <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}"
  12. BorderThickness="{TemplateBinding BorderThickness}"
  13. Background="{TemplateBinding Background}"
  14. SnapsToDevicePixels="True"
  15. CornerRadius="3">
  16. <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
  17. HorizontalScrollBarVisibility="Hidden"
  18. VerticalScrollBarVisibility="Hidden"
  19. VerticalAlignment="Center" MinHeight="20"/>
  20. </Border>
  21. <ControlTemplate.Triggers>
  22. <Trigger Property="IsEnabled" Value="false">
  23. <Setter Property="Opacity" TargetName="Border" Value="0.56"/>
  24. </Trigger>
  25. <Trigger Property="IsMouseOver" Value="true">
  26. <Setter Property="BorderBrush" TargetName="Border" Value="#FF7EB4EA"/>
  27. </Trigger>
  28. <Trigger Property="IsKeyboardFocused" Value="true">
  29. <Setter Property="BorderBrush" TargetName="Border" Value="#FF569DE5"/>
  30. </Trigger>
  31. </ControlTemplate.Triggers>
  32. </ControlTemplate>
  33. </Setter.Value>
  34. </Setter>
  35. </Style>
  36. <Style TargetType="TextBox" x:Key="AccountTextBoxStyle" BasedOn="{StaticResource RoundCornerTextBox}"></Style>
  37. <Style TargetType="TextBox" x:Key="PasswordTextBoxStyle" BasedOn="{StaticResource RoundCornerTextBox}">
  38. <Setter Property="Padding" Value="15,0,30,0"/>
  39. </Style>
  40. </ResourceDictionary>