2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
|
using System.Reflection;
|
2025-02-10 20:53:40 +08:00
|
|
|
|
using System.Windows.Markup;
|
|
|
|
|
|
|
|
|
|
|
|
namespace WPFluent.Markup;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-24 20:56:44 +08:00
|
|
|
|
/// 提供一个字典实现,其中包含 WPF 应用程序的组件和其他元素使用的 <c>WPF UI</c> 控件资源。
|
2025-02-10 20:53:40 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <example>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
/// <code lang="xml">/// <Application /// xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"> ///
|
2025-02-10 20:53:40 +08:00
|
|
|
|
/// <Application.Resources> /// <ResourceDictionary> ///
|
|
|
|
|
|
/// <ResourceDictionary.MergedDictionaries> /// <ui:ControlsDictionary /> ///
|
|
|
|
|
|
/// </ResourceDictionary.MergedDictionaries> /// </ResourceDictionary> ///
|
|
|
|
|
|
/// </Application.Resources> /// </Application> ///</code>
|
|
|
|
|
|
/// </example>
|
|
|
|
|
|
[Localizability(LocalizationCategory.Ignore)]
|
|
|
|
|
|
[Ambient]
|
|
|
|
|
|
[UsableDuringInitialization(true)]
|
|
|
|
|
|
public class ControlsDictionary : ResourceDictionary
|
|
|
|
|
|
{
|
2025-07-11 09:20:23 +08:00
|
|
|
|
private string DictionaryUri => $"pack://application:,,,/{Assembly.GetExecutingAssembly().GetName().Name};component/Resources/Styles.xaml";
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
|
|
public ControlsDictionary() { Source = new Uri(DictionaryUri, UriKind.Absolute); }
|
|
|
|
|
|
}
|