You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
4.5 KiB

  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:bpa="clr-namespace:BPA.UIControl">
  4. <ResourceDictionary.MergedDictionaries>
  5. <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/TextBox.xaml" />
  6. </ResourceDictionary.MergedDictionaries>
  7. <Style x:Key="RubyerRenamer" TargetType="{x:Type bpa:Renamer}">
  8. <Setter Property="Background" Value="{DynamicResource ControlBackground}" />
  9. <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
  10. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  11. <Setter Property="BorderThickness" Value="{DynamicResource DefaultBorderThickness}" />
  12. <Setter Property="Height" Value="28" />
  13. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  14. <Setter Property="VerticalContentAlignment" Value="Center" />
  15. <Setter Property="SnapsToDevicePixels" Value="True" />
  16. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  17. <Setter Property="Content" Value="{Binding Text, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
  18. <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllControlCornerRadius}" />
  19. <Setter Property="bpa:ControlHelper.FocusBorderBrush" Value="{DynamicResource Primary}" />
  20. <Setter Property="bpa:ControlHelper.MouseOverBrush" Value="{DynamicResource Primary}" />
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="{x:Type bpa:Renamer}">
  24. <Grid>
  25. <TextBox x:Name="PART_TextBox"
  26. Style="{StaticResource RubyerTextBox}"
  27. Height="Auto"
  28. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  29. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  30. bpa:ControlHelper.CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  31. bpa:ControlHelper.FocusBorderBrush="{Binding Path=(bpa:ControlHelper.FocusBorderBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  32. bpa:ControlHelper.MouseOverBrush="{Binding Path=(bpa:ControlHelper.MouseOverBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  33. bpa:InputBoxHelper.IsClearable="{Binding Path=(bpa:InputBoxHelper.IsClearable), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  34. bpa:InputBoxHelper.PostContent="{Binding Path=(bpa:InputBoxHelper.PostContent), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  35. bpa:InputBoxHelper.PreContent="{Binding Path=(bpa:InputBoxHelper.PreContent), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  36. bpa:InputBoxHelper.Watermark="{Binding Path=(bpa:InputBoxHelper.Watermark), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  37. BorderBrush="{TemplateBinding BorderBrush}"
  38. BorderThickness="{TemplateBinding BorderThickness}"
  39. Focusable="{TemplateBinding Focusable}"
  40. Foreground="{TemplateBinding Foreground}"
  41. Text="{Binding Text, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  42. Visibility="Collapsed" />
  43. <ContentPresenter x:Name="contentPresenter"
  44. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  45. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  46. Focusable="False"
  47. RecognizesAccessKey="True"
  48. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  49. Visibility="{TemplateBinding IsRenaming, Converter={StaticResource BooleanToHiddenConverter}}" />
  50. </Grid>
  51. </ControlTemplate>
  52. </Setter.Value>
  53. </Setter>
  54. </Style>
  55. </ResourceDictionary>