整理控件库
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ internal static class Highlighter
|
||||
|
||||
private static bool IsLightTheme()
|
||||
{
|
||||
return Appearance.ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Light;
|
||||
return Appearance.ThemeManager.GetAppTheme() == ThemeType.Light;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
16
WPFluent/Controls/CodeBlock/SyntaxHighlight.xaml
Normal file
16
WPFluent/Controls/CodeBlock/SyntaxHighlight.xaml
Normal 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>
|
||||
@@ -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.
|
||||
|
||||
16
WPFluent/Controls/CodeBlock/SyntaxLanguage.cs
Normal file
16
WPFluent/Controls/CodeBlock/SyntaxLanguage.cs
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user