Files
Shrlalgo.RvKits/Melskin/Appearance/ControlsDictionary.cs
2026-02-17 22:17:13 +08:00

26 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Windows.Markup;
namespace Melskin.Appearance;
/// <summary>
/// ControlsDictionary 类继承自 ResourceDictionary用于定义和管理控件相关的样式资源。
/// 该类在构造时自动加载指定路径下的样式资源文件,并将其设置为资源字典的源。
/// </summary>
/// <remarks>
/// 通过使用此字典,开发者可以方便地访问和应用应用程序中定义的一系列控件样式。这些样式通常包括颜色、字体以及其他视觉属性,
/// 有助于保持应用程序界面的一致性与美观。ControlsDictionary 在初始化时会指向一个预定义的样式文件(通过 ThemeManager.ThemesDictionaryPath 和 "Generic.xaml" 构建的 URI
/// 从而确保了所有引用该字典的控件都能够正确地展示出设计者所期望的外观。
/// </remarks>
[Localizability(LocalizationCategory.Ignore)]
[Ambient]
[UsableDuringInitialization(true)]
public class ControlsDictionary : ResourceDictionary
{
private static string DictionaryUri => $"{ThemeManager.ThemesDictionaryPath}Generic.xaml";
/// <summary>
/// 初始化一个新实例<see cref="ControlsDictionary"/>类。 控件字典的默认构造函数定义<see cref="ResourceDictionary.Source"/>
/// </summary>
public ControlsDictionary() { Source = new Uri(DictionaryUri, UriKind.Absolute); }
}