|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:bpa="clr-namespace:BPA.UIControl">
-
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Button.xaml" />
- </ResourceDictionary.MergedDictionaries>
-
- <Style x:Key="RubyerNotificationCard" TargetType="{x:Type bpa:NotificationCard}">
- <Setter Property="Background" Value="{DynamicResource FloatBackground}" />
- <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="CornerRadius" Value="{DynamicResource AllContainerCornerRadius}" />
- <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
- <Setter Property="ThemeColorBrush" Value="{DynamicResource DefaultForeground}" />
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="IsShow" Value="True" />
- <Setter Property="Margin" Value="2" />
- <Setter Property="MinWidth" Value="250" />
- <Setter Property="MaxWidth" Value="400" />
- <Setter Property="Padding" Value="10 0" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="Focusable" Value="False" />
- <Setter Property="bpa:HeaderHelper.Background" Value="{Binding Background, RelativeSource={RelativeSource Self}}" />
- <Setter Property="bpa:HeaderHelper.Foreground" Value="{DynamicResource DefaultForeground}" />
- <Setter Property="bpa:HeaderHelper.FontSize" Value="{Binding FontSize, RelativeSource={RelativeSource Self}}" />
- <Setter Property="bpa:HeaderHelper.FontWeight" Value="Normal" />
- <Setter Property="bpa:HeaderHelper.HorizontalAlignment" Value="Left" />
- <Setter Property="bpa:HeaderHelper.VerticalAlignment" Value="Center" />
- <Setter Property="bpa:HeaderHelper.Padding" Value="10 5" />
- <Setter Property="bpa:HeaderHelper.CornerRadius" Value="{DynamicResource TopContainerCornerRadius}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type bpa:NotificationCard}">
- <bpa:Transition x:Name="Path_Transition"
- IsShow="{TemplateBinding IsShow}"
- Type="CollapseUp"
- Duration="0:0:0.5">
- <Border x:Name="rootBorder"
- Margin="{TemplateBinding Margin}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding ThemeColorBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{TemplateBinding CornerRadius}">
- <Border.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </Border.RenderTransform>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Grid.RowSpan="2"
- Padding="{TemplateBinding Padding}"
- Background="{TemplateBinding Background}"
- CornerRadius="{TemplateBinding CornerRadius}"
- Effect="{DynamicResource AllDirectionEffect2}" />
-
- <Border x:Name="titleBorder"
- Background="{Binding Path=(bpa:HeaderHelper.Background), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- CornerRadius="{Binding Path=(bpa:HeaderHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}">
- <DockPanel>
- <Button x:Name="PART_CloseButton"
- Style="{StaticResource TextButton}"
- Height="Auto"
- Padding="5"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- bpa:ControlHelper.CornerRadius="{TemplateBinding CornerRadius}"
- DockPanel.Dock="Right"
- Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}">
- <bpa:Icon Type="CloseLine" />
- </Button>
-
- <TextBlock x:Name="title"
- Margin="{Binding Path=(bpa:HeaderHelper.Padding), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- HorizontalAlignment="{Binding Path=(bpa:HeaderHelper.HorizontalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- VerticalAlignment="{Binding Path=(bpa:HeaderHelper.VerticalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- FontSize="{Binding Path=(bpa:HeaderHelper.FontSize), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- FontWeight="{Binding Path=(bpa:HeaderHelper.FontWeight), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}"
- Text="{TemplateBinding Title}" />
- </DockPanel>
- </Border>
-
- <Grid Grid.Row="1" Margin="0 0 0 10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition x:Name="iconColumn" Width="40" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <bpa:Icon x:Name="icon"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="{TemplateBinding ThemeColorBrush}">
- <bpa:Icon.Width>
- <MultiBinding Converter="{StaticResource MathAddConverter}">
- <Binding Path="FontSize" RelativeSource="{RelativeSource Self}" />
- <Binding Source="18" />
- </MultiBinding>
- </bpa:Icon.Width>
- </bpa:Icon>
-
- <ContentPresenter x:Name="contentPresenter"
- Grid.Column="1"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Focusable="False"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
- <ContentPresenter.Resources>
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextWrapping" Value="Wrap" />
- </Style>
- </ContentPresenter.Resources>
- </ContentPresenter>
- </Grid>
- </Grid>
- </Border>
- </bpa:Transition>
- <ControlTemplate.Triggers>
- <Trigger Property="Type" Value="None">
- <Setter TargetName="iconColumn" Property="Width" Value="0" />
- <Setter TargetName="icon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="Type" Value="Info">
- <Setter TargetName="icon" Property="Type" Value="InformationFill" />
- <Setter Property="ThemeColorBrush" Value="{DynamicResource Info}" />
- <Setter Property="Title" Value="{StaticResource I18N_Info}" />
- </Trigger>
- <Trigger Property="Type" Value="Warning">
- <Setter TargetName="icon" Property="Type" Value="ErrorWarningFill" />
- <Setter Property="ThemeColorBrush" Value="{DynamicResource Warning}" />
- <Setter Property="Title" Value="{StaticResource I18N_Warning}" />
- </Trigger>
- <Trigger Property="Type" Value="Success">
- <Setter TargetName="icon" Property="Type" Value="CheckboxCircleFill" />
- <Setter Property="ThemeColorBrush" Value="{DynamicResource Success}" />
- <Setter Property="Title" Value="{StaticResource I18N_Success}" />
- </Trigger>
- <Trigger Property="Type" Value="Error">
- <Setter TargetName="icon" Property="Type" Value="CloseCircleFill" />
- <Setter Property="ThemeColorBrush" Value="{DynamicResource Error}" />
- <Setter Property="Title" Value="{StaticResource I18N_Error}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|