整理
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:assists="clr-namespace:NeumUI.Assists"
|
||||
xmlns:controls="clr-namespace:NeumUI.Controls"
|
||||
xmlns:conv="clr-namespace:NeumUI.Converters"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:assists="clr-namespace:NeoUI.Assists"
|
||||
xmlns:controls="clr-namespace:NeoUI.Controls"
|
||||
xmlns:conv="clr-namespace:NeoUI.Converters">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/NeumUI;component/Animations/Animations.xaml" />
|
||||
<ResourceDictionary Source="/NeumUI;component/Assets/CommonGeometry.xaml" />
|
||||
<ResourceDictionary Source="/NeoUI;component/Animations/Animations.xaml" />
|
||||
<ResourceDictionary Source="/NeoUI;component/Assets/CommonGeometry.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style TargetType="{x:Type controls:Alert}">
|
||||
@@ -59,17 +59,17 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Alert}">
|
||||
<Border
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
UseLayoutRounding="True">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<!-- TODO 是否可复用? -->
|
||||
<Style TargetType="{x:Type Button}" x:Key="AlertCloseButton">
|
||||
<Style x:Key="AlertCloseButton" TargetType="{x:Type Button}">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
@@ -77,7 +77,7 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<ControlTemplate.Resources>
|
||||
<Style TargetType="{x:Type controls:SymbolIcon}">
|
||||
<Style TargetType="{x:Type controls:IconElement}">
|
||||
<Setter Property="Opacity" Value="0.65" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
||||
<Style.Triggers>
|
||||
@@ -120,14 +120,14 @@
|
||||
</Grid.RowDefinitions>
|
||||
<!-- Icon -->
|
||||
<Viewbox
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="Icon"
|
||||
Width="{TemplateBinding FontSize}"
|
||||
x:Name="Icon">
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<Path
|
||||
x:Name="IconPath"
|
||||
Fill="{TemplateBinding IconBrush}"
|
||||
Visibility="{Binding ShowIcon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static conv:BooleanToVisibilityConverter.CollapsedInstance}}"
|
||||
x:Name="IconPath" />
|
||||
Visibility="{Binding ShowIcon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static conv:BooleanToVisibilityConverter.CollapsedInstance}}" />
|
||||
</Viewbox>
|
||||
|
||||
<!--<controls:SymbolIcon
|
||||
@@ -138,51 +138,49 @@
|
||||
x:Name="Icon" />-->
|
||||
<!-- Message -->
|
||||
<ContentPresenter
|
||||
Content="{Binding Message, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
x:Name="Message"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="Message" />
|
||||
Content="{Binding Message, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<!-- Description -->
|
||||
<ContentPresenter
|
||||
Content="{Binding Description, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
x:Name="Description"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Content="{Binding Description, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
TextElement.Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
Visibility="Collapsed"
|
||||
x:Name="Description" />
|
||||
Visibility="Collapsed" />
|
||||
<!-- Close Button -->
|
||||
<Button
|
||||
x:Name="PART_Close"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource AlertCloseButton}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="PART_Close" />
|
||||
Style="{StaticResource AlertCloseButton}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- With Description -->
|
||||
<DataTrigger Binding="{Binding Description, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={x:Static conv:NullOrEmptyConverter.Instance}}" Value="False">
|
||||
<!--<Setter TargetName="Icon" Property="FontSize" Value="14" />-->
|
||||
<!--<Setter Property="Theme" TargetName="Icon" Value="Outlined" />-->
|
||||
<Setter Property="Margin" TargetName="Message" Value="0,0,0,4" />
|
||||
<Setter Property="Visibility" TargetName="Description" Value="Visible" />
|
||||
<Setter Property="FontSize" TargetName="PART_Close" Value="14" />
|
||||
<Setter Property="TextElement.FontSize" TargetName="Message" Value="16" />
|
||||
<Setter Property="TextElement.Foreground" TargetName="Message" Value="{DynamicResource TextPrimaryBrush}" />
|
||||
<Setter TargetName="Message" Property="Margin" Value="0,0,0,4" />
|
||||
<Setter TargetName="Description" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="PART_Close" Property="FontSize" Value="14" />
|
||||
<Setter TargetName="Message" Property="TextElement.FontSize" Value="16" />
|
||||
<Setter TargetName="Message" Property="TextElement.Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
||||
</DataTrigger>
|
||||
<Trigger Property="Type" Value="Info">
|
||||
<Setter Property="Data" TargetName="IconPath" Value="{DynamicResource info-circle}" />
|
||||
<Setter TargetName="IconPath" Property="Data" Value="{DynamicResource info-circle}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Type" Value="Success">
|
||||
<Setter Property="Data" TargetName="IconPath" Value="{DynamicResource check-circle}" />
|
||||
<Setter TargetName="IconPath" Property="Data" Value="{DynamicResource check-circle}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Type" Value="Warning">
|
||||
<Setter Property="Data" TargetName="IconPath" Value="{DynamicResource exclamation-circle}" />
|
||||
<Setter TargetName="IconPath" Property="Data" Value="{DynamicResource exclamation-circle}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Type" Value="Error">
|
||||
<Setter Property="Data" TargetName="IconPath" Value="{DynamicResource close-circle}" />
|
||||
<Setter TargetName="IconPath" Property="Data" Value="{DynamicResource close-circle}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -191,9 +189,9 @@
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Type" Value="Info">
|
||||
<!--<Setter Property="Icon" Value="info-circle" />-->
|
||||
<Setter Property="IconBrush" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryLightShadowBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryDisabledBrush}" />
|
||||
<Setter Property="IconBrush" Value="{DynamicResource InfoBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource InfoLightShadowBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource InfoDisabledBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Type" Value="Success">
|
||||
<!--<Setter Property="Icon" Value="check-circle" />-->
|
||||
|
||||
Reference in New Issue
Block a user