Generic.xaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  5. xmlns:local="clr-namespace:PDF_Office">
  6. <!-- style for customControl -->
  7. <Style TargetType="{x:Type cus:DialogContent}">
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="{x:Type cus:DialogContent}">
  11. <Border Background="White" CornerRadius="8">
  12. <Grid Background="Transparent">
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="48" />
  15. <RowDefinition Height="*" />
  16. <RowDefinition Height="64" />
  17. </Grid.RowDefinitions>
  18. <Border Background="Transparent" BorderThickness="0,0,0,1">
  19. <Border.BorderBrush>
  20. <SolidColorBrush Opacity="0.2" Color="Gray" />
  21. </Border.BorderBrush>
  22. <TextBlock
  23. Margin="16,0,0,0"
  24. VerticalAlignment="Center"
  25. FontSize="16"
  26. FontWeight="SemiBold"
  27. Text="{TemplateBinding Header}" />
  28. </Border>
  29. <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" />
  30. <Border Grid.Row="2" BorderThickness="0,1,0,0">
  31. <Border.BorderBrush>
  32. <SolidColorBrush Opacity="0.2" Color="Gray" />
  33. </Border.BorderBrush>
  34. <ContentControl Content="{TemplateBinding BottmBar}" />
  35. </Border>
  36. </Grid>
  37. </Border>
  38. </ControlTemplate>
  39. </Setter.Value>
  40. </Setter>
  41. </Style>
  42. <Style TargetType="{x:Type cus:TextBoxEx}">
  43. <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
  44. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  45. <Setter Property="Foreground" Value="Black" />
  46. <Setter Property="BorderThickness" Value="1" />
  47. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="{x:Type cus:TextBoxEx}">
  51. <Border
  52. x:Name="border"
  53. Width="{TemplateBinding Width}"
  54. Height="{TemplateBinding Height}"
  55. Background="{TemplateBinding Background}"
  56. BorderBrush="{TemplateBinding BorderBrush}"
  57. BorderThickness="{TemplateBinding BorderThickness}"
  58. CornerRadius="{TemplateBinding CornerRadius}"
  59. SnapsToDevicePixels="True">
  60. <Grid Margin="{TemplateBinding Padding}">
  61. <TextBlock
  62. x:Name="placeholder"
  63. Margin="5,0,0,0"
  64. FontSize="{TemplateBinding FontSize}"
  65. Foreground="{TemplateBinding PlaceholderForeground}"
  66. Text="{TemplateBinding PlaceholderText}"
  67. Visibility="Collapsed" />
  68. <ScrollViewer
  69. x:Name="PART_ContentHost"
  70. Margin="0,0,25,0"
  71. Padding="8,1,0,0"
  72. Focusable="false"
  73. Foreground="{TemplateBinding Foreground}"
  74. HorizontalScrollBarVisibility="Hidden"
  75. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  76. Style="{x:Null}"
  77. VerticalScrollBarVisibility="Hidden" />
  78. <Button
  79. Name="PART_BtnClear"
  80. Width="16"
  81. Height="16"
  82. Margin="9,0"
  83. HorizontalAlignment="Right"
  84. VerticalAlignment="Center"
  85. Background="Transparent"
  86. BorderThickness="0"
  87. Style="{StaticResource NoColorBtn}"
  88. Visibility="Collapsed">
  89. <Path
  90. Data="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.5303 5.53038L9.06069 8L11.5303 10.4696L10.4697 11.5303L8.00002 9.06066L5.53033 11.5303L4.46967 10.4697L6.93936 8L4.46967 5.53033L5.53033 4.46967L8.00002 6.93934L10.4697 4.46971L11.5303 5.53038Z"
  91. Fill="#CED0D4"
  92. Stretch="Uniform" />
  93. </Button>
  94. </Grid>
  95. </Border>
  96. <ControlTemplate.Triggers>
  97. <Trigger Property="IsEnabled" Value="false">
  98. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  99. </Trigger>
  100. <Trigger Property="Text" Value="{x:Null}">
  101. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  102. </Trigger>
  103. <Trigger Property="Text" Value="">
  104. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  105. </Trigger>
  106. <Trigger Property="IsMouseOver" Value="True">
  107. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  108. </Trigger>
  109. <MultiTrigger>
  110. <MultiTrigger.Conditions>
  111. <Condition Property="Text" Value="" />
  112. <Condition Property="IsMouseOver" Value="True" />
  113. </MultiTrigger.Conditions>
  114. <MultiTrigger.Setters>
  115. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  116. </MultiTrigger.Setters>
  117. </MultiTrigger>
  118. </ControlTemplate.Triggers>
  119. </ControlTemplate>
  120. </Setter.Value>
  121. </Setter>
  122. <Style.Triggers>
  123. <MultiTrigger>
  124. <MultiTrigger.Conditions>
  125. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  126. <Condition Property="IsSelectionActive" Value="false" />
  127. </MultiTrigger.Conditions>
  128. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  129. </MultiTrigger>
  130. </Style.Triggers>
  131. </Style>
  132. </ResourceDictionary>