Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

NotificationCard.xaml 11 KiB

há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
há 1 ano
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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="RubyerNotificationCard" TargetType="{x:Type bpa:NotificationCard}">
  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="Right" />
  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="250" />
  21. <Setter Property="MaxWidth" Value="400" />
  22. <Setter Property="Padding" Value="10 0" />
  23. <Setter Property="SnapsToDevicePixels" Value="True" />
  24. <Setter Property="Focusable" Value="False" />
  25. <Setter Property="bpa:HeaderHelper.Background" Value="{Binding Background, RelativeSource={RelativeSource Self}}" />
  26. <Setter Property="bpa:HeaderHelper.Foreground" Value="{DynamicResource DefaultForeground}" />
  27. <Setter Property="bpa:HeaderHelper.FontSize" Value="{Binding FontSize, RelativeSource={RelativeSource Self}}" />
  28. <Setter Property="bpa:HeaderHelper.FontWeight" Value="Normal" />
  29. <Setter Property="bpa:HeaderHelper.HorizontalAlignment" Value="Left" />
  30. <Setter Property="bpa:HeaderHelper.VerticalAlignment" Value="Center" />
  31. <Setter Property="bpa:HeaderHelper.Padding" Value="10 5" />
  32. <Setter Property="bpa:HeaderHelper.CornerRadius" Value="{DynamicResource TopContainerCornerRadius}" />
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="{x:Type bpa:NotificationCard}">
  36. <bpa:Transition x:Name="Path_Transition"
  37. IsShow="{TemplateBinding IsShow}"
  38. Type="CollapseUp"
  39. Duration="0:0:0.5">
  40. <Border x:Name="rootBorder"
  41. Margin="{TemplateBinding Margin}"
  42. Background="{TemplateBinding Background}"
  43. BorderBrush="{TemplateBinding ThemeColorBrush}"
  44. BorderThickness="{TemplateBinding BorderThickness}"
  45. CornerRadius="{TemplateBinding CornerRadius}">
  46. <Border.RenderTransform>
  47. <TransformGroup>
  48. <ScaleTransform />
  49. <SkewTransform />
  50. <RotateTransform />
  51. <TranslateTransform />
  52. </TransformGroup>
  53. </Border.RenderTransform>
  54. <Grid>
  55. <Grid.RowDefinitions>
  56. <RowDefinition Height="Auto" />
  57. <RowDefinition Height="*" />
  58. </Grid.RowDefinitions>
  59. <Border Grid.RowSpan="2"
  60. Padding="{TemplateBinding Padding}"
  61. Background="{TemplateBinding Background}"
  62. CornerRadius="{TemplateBinding CornerRadius}"
  63. Effect="{DynamicResource AllDirectionEffect2}" />
  64. <Border x:Name="titleBorder"
  65. Background="{Binding Path=(bpa:HeaderHelper.Background), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  66. CornerRadius="{Binding Path=(bpa:HeaderHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}">
  67. <DockPanel>
  68. <Button x:Name="PART_CloseButton"
  69. Style="{StaticResource TextButton}"
  70. Height="Auto"
  71. Padding="5"
  72. HorizontalAlignment="Right"
  73. VerticalAlignment="Top"
  74. bpa:ControlHelper.CornerRadius="{TemplateBinding CornerRadius}"
  75. DockPanel.Dock="Right"
  76. Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}">
  77. <bpa:Icon Type="CloseLine" />
  78. </Button>
  79. <TextBlock x:Name="title"
  80. Margin="{Binding Path=(bpa:HeaderHelper.Padding), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  81. HorizontalAlignment="{Binding Path=(bpa:HeaderHelper.HorizontalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  82. VerticalAlignment="{Binding Path=(bpa:HeaderHelper.VerticalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  83. FontSize="{Binding Path=(bpa:HeaderHelper.FontSize), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  84. FontWeight="{Binding Path=(bpa:HeaderHelper.FontWeight), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  85. Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  86. Text="{TemplateBinding Title}" />
  87. </DockPanel>
  88. </Border>
  89. <Grid Grid.Row="1" Margin="0 0 0 10">
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition x:Name="iconColumn" Width="40" />
  92. <ColumnDefinition Width="*" />
  93. </Grid.ColumnDefinitions>
  94. <bpa:Icon x:Name="icon"
  95. HorizontalAlignment="Right"
  96. VerticalAlignment="Center"
  97. Foreground="{TemplateBinding ThemeColorBrush}">
  98. <bpa:Icon.Width>
  99. <MultiBinding Converter="{StaticResource MathAddConverter}">
  100. <Binding Path="FontSize" RelativeSource="{RelativeSource Self}" />
  101. <Binding Source="18" />
  102. </MultiBinding>
  103. </bpa:Icon.Width>
  104. </bpa:Icon>
  105. <ContentPresenter x:Name="contentPresenter"
  106. Grid.Column="1"
  107. Margin="{TemplateBinding Padding}"
  108. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  109. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  110. Focusable="False"
  111. RecognizesAccessKey="True"
  112. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  113. <ContentPresenter.Resources>
  114. <Style TargetType="{x:Type TextBlock}">
  115. <Setter Property="TextWrapping" Value="Wrap" />
  116. </Style>
  117. </ContentPresenter.Resources>
  118. </ContentPresenter>
  119. </Grid>
  120. </Grid>
  121. </Border>
  122. </bpa:Transition>
  123. <ControlTemplate.Triggers>
  124. <Trigger Property="Type" Value="None">
  125. <Setter TargetName="iconColumn" Property="Width" Value="0" />
  126. <Setter TargetName="icon" Property="Visibility" Value="Collapsed" />
  127. </Trigger>
  128. <Trigger Property="Type" Value="Info">
  129. <Setter TargetName="icon" Property="Type" Value="InformationFill" />
  130. <Setter Property="ThemeColorBrush" Value="{DynamicResource Info}" />
  131. <Setter Property="Title" Value="{StaticResource I18N_Info}" />
  132. </Trigger>
  133. <Trigger Property="Type" Value="Warning">
  134. <Setter TargetName="icon" Property="Type" Value="ErrorWarningFill" />
  135. <Setter Property="ThemeColorBrush" Value="{DynamicResource Warning}" />
  136. <Setter Property="Title" Value="{StaticResource I18N_Warning}" />
  137. </Trigger>
  138. <Trigger Property="Type" Value="Success">
  139. <Setter TargetName="icon" Property="Type" Value="CheckboxCircleFill" />
  140. <Setter Property="ThemeColorBrush" Value="{DynamicResource Success}" />
  141. <Setter Property="Title" Value="{StaticResource I18N_Success}" />
  142. </Trigger>
  143. <Trigger Property="Type" Value="Error">
  144. <Setter TargetName="icon" Property="Type" Value="CloseCircleFill" />
  145. <Setter Property="ThemeColorBrush" Value="{DynamicResource Error}" />
  146. <Setter Property="Title" Value="{StaticResource I18N_Error}" />
  147. </Trigger>
  148. </ControlTemplate.Triggers>
  149. </ControlTemplate>
  150. </Setter.Value>
  151. </Setter>
  152. </Style>
  153. </ResourceDictionary>