整理控件库

This commit is contained in:
GG Z
2025-05-05 17:04:06 +08:00
parent 74532b77be
commit 3eaad7566e
283 changed files with 2156 additions and 17846 deletions

View File

@@ -61,10 +61,10 @@ public class CodeBlock : System.Windows.Controls.ContentControl
{
SetValue(ButtonCommandProperty, new RelayCommand<string>(OnTemplateButtonClick));
ApplicationThemeManager.Changed += ThemeOnChanged;
ThemeManager.Changed += ThemeOnChanged;
}
private void ThemeOnChanged(ApplicationTheme currentApplicationTheme, Color systemAccent)
private void ThemeOnChanged(ThemeType currentApplicationTheme, Color systemAccent)
{
UpdateSyntax();
}

View File

@@ -190,7 +190,7 @@ internal static class Highlighter
private static bool IsLightTheme()
{
return Appearance.ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Light;
return Appearance.ThemeManager.GetAppTheme() == ThemeType.Light;
}
/*

View File

@@ -0,0 +1,16 @@
<!--
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 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- https://github.com/tonsky/FiraCode -->
<FontFamily x:Key="FiraCode">pack://application:,,,/Wpf.Ui;component/Fonts/#Fira Code</FontFamily>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Controls/CodeBlock/CodeBlock.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -18,7 +18,7 @@ namespace WPFluent.Controls;
public class SyntaxHighlightDictionary : ResourceDictionary
{
private const string DictionaryUri =
"pack://application:,,,/WPFluent;component/SyntaxHighlight/SyntaxHighlight.xaml";
"pack://application:,,,/WPFluent;component/Controls/CodeBlock/SyntaxHighlight.xaml";
/// <summary>
/// Initializes a new instance of the <see cref="SyntaxHighlightDictionary"/> class.

View File

@@ -0,0 +1,16 @@
// 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.
namespace WPFluent.Controls;
/// <summary>
/// Supported languages for syntax highlighting.
/// </summary>
internal enum SyntaxLanguage
{
Autodetect,
XAML,
CSHARP,
}