ColorVision.Themes
1.5.4.1
dotnet add package ColorVision.Themes --version 1.5.4.1
NuGet\Install-Package ColorVision.Themes -Version 1.5.4.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ColorVision.Themes" Version="1.5.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ColorVision.Themes" Version="1.5.4.1" />
<PackageReference Include="ColorVision.Themes" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ColorVision.Themes --version 1.5.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ColorVision.Themes, 1.5.4.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ColorVision.Themes@1.5.4.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ColorVision.Themes&version=1.5.4.1
#tool nuget:?package=ColorVision.Themes&version=1.5.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ColorVision.Themes
🎯 功能定位
主题管理和样式系统,提供ColorVision应用程序的视觉主题和自定义控件样式。
作用范围
UI视觉层,为整个应用程序提供统一的主题风格和自定义控件外观。
主要功能点
主题支持
- 深色主题 - 适合长时间使用的暗色调主题
- 浅色主题 - 明亮清晰的浅色调主题
- 粉色主题 - 柔和的粉色调主题
- 青色主题 - 清新的青色调主题
- 跟随系统 - 自动适配系统主题设置
自定义控件
- 上传控件 - 文件上传界面组件
- 下载控件 - 文件下载进度显示
- 消息弹窗 - 统一样式的消息提示窗口
- 对话框 - 自定义样式的对话框控件
- 按钮样式 - 多种按钮风格和状态
- 输入控件 - 文本框、下拉框等输入控件样式
主题切换
- 运行时切换 - 支持应用运行时动态切换主题
- 配置持久化 - 主题选择自动保存和恢复
- 平滑过渡 - 主题切换时的视觉过渡效果
与主程序的依赖关系
被引用方式:
- ColorVision.UI - 引用主题资源和样式
- ColorVision - 主程序应用主题
- 所有插件和项目 - 继承主题样式
引用的外部依赖:
- WPF基础库
- ColorVision.Common - 配置接口
使用方式
引用方式
<ProjectReference Include="..\ColorVision.Themes\ColorVision.Themes.csproj" />
应用主题
// 设置主题
this.ApplyTheme(ThemeConfig.Instance.Theme);
// 切换主题
ThemeConfig.Instance.Theme = ThemeType.Dark;
this.ApplyTheme(ThemeConfig.Instance.Theme);
在XAML中使用主题资源
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />
<ResourceDictionary Source="/HandyControl;component/Themes/basic/colors/colors.xaml"/>
<ResourceDictionary Source="/HandyControl;component/Themes/Theme.xaml"/>
<ResourceDictionary Source="/ColorVision.Themes;component/Themes/White.xaml"/>
<ResourceDictionary Source="/ColorVision.Themes;component/Themes/Base.xaml"/>
<ResourceDictionary Source="/ColorVision.Themes;component/Themes/Menu.xaml"/>
<ResourceDictionary Source="/ColorVision.Themes;component/Themes/GroupBox.xaml"/>
<ResourceDictionary Source="/ColorVision.Themes;component/Themes/Icons.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Window>
主题配置
ThemeConfig设置
public class ThemeConfig : IConfig
{
public ThemeType Theme { get; set; } = ThemeType.Dark;
public bool FollowSystem { get; set; } = false;
}
支持的主题类型
ThemeType.Dark- 深色主题ThemeType.Light- 浅色主题ThemeType.Pink- 粉色主题ThemeType.Cyan- 青色主题
开发调试
dotnet build UI/ColorVision.Themes/ColorVision.Themes.csproj
目录说明
Themes/- 主题资源文件目录Controls/- 自定义控件实现Converters/- 值转换器Resources/- 图像和图标资源
相关文档链接
维护者
ColorVision UI团队
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0-windows7.0
- HandyControl (>= 3.5.1)
- WPF-UI (>= 4.2.0)
-
net8.0-windows7.0
- HandyControl (>= 3.5.1)
- WPF-UI (>= 4.2.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on ColorVision.Themes:
| Package | Downloads |
|---|---|
|
ColorVision.UI
Package Description |
|
|
ColorVision.ImageEditor
Package Description |
|
|
ColorVision.Scheduler
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.4.1 | 82 | 3/31/2026 |
| 1.5.1.2 | 72 | 3/31/2026 |
| 1.5.1.1 | 133 | 2/16/2026 |
| 1.4.1.1 | 114 | 2/3/2026 |
| 1.3.10.1 | 126 | 1/14/2026 |
| 1.3.8.3 | 324 | 10/17/2025 |
| 1.3.8.2 | 213 | 9/30/2025 |
| 1.3.8.1 | 256 | 9/25/2025 |
| 1.3.7.1 | 259 | 9/21/2025 |
| 1.3.6.1 | 197 | 9/5/2025 |
| 1.3.5.1 | 288 | 8/24/2025 |
| 1.3.4.1 | 206 | 8/18/2025 |
| 1.3.2.2 | 253 | 6/3/2025 |
| 1.3.2.1 | 202 | 6/2/2025 |
| 1.3.1.1 | 205 | 5/29/2025 |
| 1.2.4.1 | 210 | 5/26/2025 |
| 1.2.3.4 | 195 | 5/23/2025 |
| 1.2.3.3 | 197 | 5/22/2025 |
| 1.2.3.2 | 214 | 5/19/2025 |
| 1.2.3.1 | 289 | 5/12/2025 |
Loading failed