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.

128 lines
8.1 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/Button.xaml" />
  6. </ResourceDictionary.MergedDictionaries>
  7. <Style x:Key="RubyerMessageCard" TargetType="{x:Type bpa:MessageCard}">
  8. <Setter Property="Background" Value="{DynamicResource FloatBackground}" />
  9. <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
  10. <Setter Property="BorderThickness" Value="0" />
  11. <Setter Property="CornerRadius" Value="{DynamicResource AllContainerCornerRadius}" />
  12. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  13. <Setter Property="ThemeColorBrush" Value="{DynamicResource DefaultForeground}" />
  14. <Setter Property="HorizontalAlignment" Value="Center" />
  15. <Setter Property="HorizontalContentAlignment" Value="Left" />
  16. <Setter Property="VerticalAlignment" Value="Center" />
  17. <Setter Property="VerticalContentAlignment" Value="Center" />
  18. <Setter Property="IsShow" Value="True" />
  19. <Setter Property="Margin" Value="2" />
  20. <Setter Property="MinWidth" Value="200" />
  21. <Setter Property="MaxWidth" Value="600" />
  22. <Setter Property="Padding" Value="5" />
  23. <Setter Property="SnapsToDevicePixels" Value="True" />
  24. <Setter Property="Focusable" Value="False" />
  25. <Setter Property="Template">
  26. <Setter.Value>
  27. <ControlTemplate TargetType="{x:Type bpa:MessageCard}">
  28. <bpa:Transition x:Name="Path_Transition"
  29. IsShow="{TemplateBinding IsShow}"
  30. Type="CollapseDown">
  31. <bpa:Transition.CloseEasingFunction>
  32. <CubicEase EasingMode="EaseIn" />
  33. </bpa:Transition.CloseEasingFunction>
  34. <Border x:Name="rootBorder"
  35. Margin="{TemplateBinding Margin}"
  36. Background="{TemplateBinding Background}"
  37. BorderBrush="{TemplateBinding ThemeColorBrush}"
  38. BorderThickness="{TemplateBinding BorderThickness}"
  39. CornerRadius="{TemplateBinding CornerRadius}">
  40. <Border.RenderTransform>
  41. <TransformGroup>
  42. <ScaleTransform />
  43. <SkewTransform />
  44. <RotateTransform />
  45. <TranslateTransform />
  46. </TransformGroup>
  47. </Border.RenderTransform>
  48. <Grid>
  49. <Grid.ColumnDefinitions>
  50. <ColumnDefinition Width="Auto" />
  51. <ColumnDefinition Width="*" />
  52. <ColumnDefinition Width="Auto" />
  53. </Grid.ColumnDefinitions>
  54. <Border Grid.ColumnSpan="3"
  55. Padding="{TemplateBinding Padding}"
  56. Background="{TemplateBinding Background}"
  57. BorderBrush="{TemplateBinding ThemeColorBrush}"
  58. BorderThickness="{TemplateBinding BorderThickness}"
  59. CornerRadius="{TemplateBinding CornerRadius}"
  60. Effect="{DynamicResource AllDirectionEffect2}" />
  61. <bpa:Icon x:Name="icon"
  62. Grid.Column="0"
  63. Margin="8 0 0 0"
  64. Foreground="{TemplateBinding ThemeColorBrush}">
  65. <bpa:Icon.Width>
  66. <MultiBinding Converter="{StaticResource MathAddConverter}">
  67. <Binding Path="FontSize" RelativeSource="{RelativeSource Self}" />
  68. <Binding Source="18" />
  69. </MultiBinding>
  70. </bpa:Icon.Width>
  71. </bpa:Icon>
  72. <ContentPresenter x:Name="contentPresenter"
  73. Grid.Column="1"
  74. Margin="8"
  75. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  76. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  77. Focusable="False"
  78. RecognizesAccessKey="True"
  79. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  80. <ContentPresenter.Resources>
  81. <Style TargetType="{x:Type TextBlock}">
  82. <Setter Property="TextWrapping" Value="Wrap" />
  83. </Style>
  84. </ContentPresenter.Resources>
  85. </ContentPresenter>
  86. <Button x:Name="PART_CloseButton"
  87. Style="{StaticResource TextButton}"
  88. Grid.Column="2"
  89. Height="Auto"
  90. Padding="5"
  91. VerticalAlignment="Center"
  92. bpa:ControlHelper.CornerRadius="{TemplateBinding CornerRadius}"
  93. Foreground="{TemplateBinding Foreground}"
  94. Visibility="{TemplateBinding IsClearable, Converter={StaticResource BooleanToVisibleConverter}}">
  95. <bpa:Icon Type="CloseLine" />
  96. </Button>
  97. </Grid>
  98. </Border>
  99. </bpa:Transition>
  100. <ControlTemplate.Triggers>
  101. <Trigger Property="Type" Value="None">
  102. <Setter TargetName="icon" Property="Visibility" Value="Collapsed" />
  103. </Trigger>
  104. <Trigger Property="Type" Value="Info">
  105. <Setter TargetName="icon" Property="Type" Value="InformationFill" />
  106. <Setter Property="ThemeColorBrush" Value="{DynamicResource Info}" />
  107. </Trigger>
  108. <Trigger Property="Type" Value="Warning">
  109. <Setter TargetName="icon" Property="Type" Value="ErrorWarningFill" />
  110. <Setter Property="ThemeColorBrush" Value="{DynamicResource Warning}" />
  111. </Trigger>
  112. <Trigger Property="Type" Value="Success">
  113. <Setter TargetName="icon" Property="Type" Value="CheckboxCircleFill" />
  114. <Setter Property="ThemeColorBrush" Value="{DynamicResource Success}" />
  115. </Trigger>
  116. <Trigger Property="Type" Value="Error">
  117. <Setter TargetName="icon" Property="Type" Value="CloseCircleFill" />
  118. <Setter Property="ThemeColorBrush" Value="{DynamicResource Error}" />
  119. </Trigger>
  120. </ControlTemplate.Triggers>
  121. </ControlTemplate>
  122. </Setter.Value>
  123. </Setter>
  124. </Style>
  125. </ResourceDictionary>