This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -1,31 +1,22 @@
<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
-->
<ResourceDictionary
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFluent.Controls">
<!--<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WPFluent;component/Themes/Light.xaml"/>
</ResourceDictionary.MergedDictionaries>-->
<Thickness x:Key="InfoBarPadding">14,8,14,8</Thickness>
<Thickness x:Key="InfoBarBorderThemeThickness">1</Thickness>
<Style TargetType="{x:Type controls:InfoBar}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource ControlFillColorDefault}" />
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="{DynamicResource InfoBarTitleForeground}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Padding" Value="{StaticResource InfoBarPadding}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource InfoBarBorderBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource InfoBarBorderThemeThickness}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
@@ -60,7 +51,6 @@
Filled="True"
FontSize="16" />
</Border>
<WrapPanel Grid.Column="1" VerticalAlignment="Top">
<TextBlock
x:Name="InfoTitle"
@@ -114,29 +104,25 @@
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="Severity" Value="Informational">
<Setter TargetName="SymbolIcon" Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
</Setter.Value>
</Setter>
<Trigger Property="Severity" Value="Attention">
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource SystemFillColorAttentionBrush}"/>
<Setter TargetName="SymbolIcon" Property="Symbol" Value="Info24" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource InfoBarInformationalSeverityBackgroundBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorAttentionBackgroundBrush}" />
</Trigger>
<Trigger Property="Severity" Value="Success">
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource InfoBarSuccessSeverityIconBackground}" />
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource SystemFillColorSuccessBrush}" />
<Setter TargetName="SymbolIcon" Property="Symbol" Value="CheckmarkCircle24" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource InfoBarSuccessSeverityBackgroundBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorSuccessBackgroundBrush}" />
</Trigger>
<Trigger Property="Severity" Value="Warning">
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource InfoBarWarningSeverityIconBackground}" />
<Trigger Property="Severity" Value="Caution">
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource SystemFillColorCautionBrush}" />
<Setter TargetName="SymbolIcon" Property="Symbol" Value="ErrorCircle24" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource InfoBarWarningSeverityBackgroundBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCautionBackgroundBrush}" />
</Trigger>
<Trigger Property="Severity" Value="Error">
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource InfoBarErrorSeverityIconBackground}" />
<Trigger Property="Severity" Value="Critical">
<Setter TargetName="SymbolIcon" Property="Foreground" Value="{DynamicResource SystemFillColorCriticalBrush}" />
<Setter TargetName="SymbolIcon" Property="Symbol" Value="DismissCircle24" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource InfoBarErrorSeverityBackgroundBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCriticalBackgroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

View File

@@ -47,7 +47,7 @@ public class InfoBar : System.Windows.Controls.ContentControl
nameof(Severity),
typeof(InfoBarSeverity),
typeof(InfoBar),
new PropertyMetadata(InfoBarSeverity.Informational));
new PropertyMetadata(InfoBarSeverity.Attention));
/// <summary>
/// Identifies the <see cref="TemplateButtonCommand"/> dependency property.

View File

@@ -7,24 +7,19 @@ namespace WPFluent.Controls;
public enum InfoBarSeverity
{
/// <summary>
/// Communicates that the InfoBar is displaying general information that requires the user's attention.
/// 注意
/// </summary>
Informational = 0,
Attention = 0,
/// <summary>
/// Communicates that the InfoBar is displaying information regarding a long-running and/or background task that has
/// completed successfully.
/// 成功
/// </summary>
Success = 1,
/// <summary>
/// Communicates that the InfoBar is displaying information regarding a condition that might cause a problem in the
/// future.
/// 警告
/// </summary>
Warning = 2,
Caution = 2,
/// <summary>
/// Communicates that the InfoBar is displaying information regarding an error or problem that has occurred.
/// 紧要、关键
/// </summary>
Error = 3,
Critical = 3,
}