ColorVision.Themes 1.3.8.3

dotnet add package ColorVision.Themes --version 1.3.8.3
                    
NuGet\Install-Package ColorVision.Themes -Version 1.3.8.3
                    
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.3.8.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ColorVision.Themes" Version="1.3.8.3" />
                    
Directory.Packages.props
<PackageReference Include="ColorVision.Themes" />
                    
Project file
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.3.8.3
                    
#r "nuget: ColorVision.Themes, 1.3.8.3"
                    
#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.3.8.3
                    
#: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.3.8.3
                    
Install as a Cake Addin
#tool nuget:?package=ColorVision.Themes&version=1.3.8.3
                    
Install as a Cake Tool

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 Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3.8.3 85 10/17/2025
1.3.8.2 170 9/30/2025
1.3.8.1 203 9/25/2025
1.3.7.1 213 9/21/2025
1.3.6.1 153 9/5/2025
1.3.5.1 244 8/24/2025
1.3.4.1 155 8/18/2025
1.3.2.2 208 6/3/2025
1.3.2.1 170 6/2/2025
1.3.1.1 166 5/29/2025
1.2.4.1 168 5/26/2025
1.2.3.4 160 5/23/2025
1.2.3.3 163 5/22/2025
1.2.3.2 171 5/19/2025
1.2.3.1 248 5/12/2025
1.2.1.1 168 5/6/2025
1.1.12.2 183 4/9/2025
1.1.12.1 182 4/2/2025
1.1.11.5 194 3/22/2025
1.1.11.4 175 3/20/2025
1.1.11.3 176 3/13/2025
1.1.11.1 163 3/3/2025
1.1.10.7 150 2/21/2025
1.1.10.6 143 2/20/2025
1.1.10.5 135 2/14/2025
1.1.10.4 127 2/12/2025
1.1.10.3 147 2/12/2025
1.1.10.2 127 2/12/2025
1.1.10.1 129 2/11/2025
1.1.9.29 151 2/7/2025
1.1.9.28 139 2/6/2025
1.1.9.27 129 2/6/2025
1.1.9.26 129 2/5/2025
1.1.9.25 111 1/24/2025
1.1.9.24 119 1/22/2025
1.1.9.23 138 1/21/2025
1.1.9.22 127 1/21/2025
1.1.9.21 135 1/21/2025
1.1.9.20 142 1/20/2025
1.1.9.19 129 1/17/2025
1.1.9.18 100 1/15/2025
1.1.9.17 94 1/14/2025
1.1.9.16 114 1/14/2025
1.1.9.15 120 1/13/2025
1.1.9.14 104 1/13/2025
1.1.9.13 111 1/13/2025
1.1.9.12 113 1/13/2025
1.1.9.11 113 1/13/2025
1.1.9.10 134 1/13/2025
1.1.9.8 129 1/13/2025
1.1.9.7 137 1/10/2025
1.1.9.6 112 1/8/2025
1.1.9.5 126 1/8/2025
1.1.9.4 135 1/6/2025
1.1.9.3 140 1/6/2025
1.1.9.2 128 1/6/2025
1.1.9.1 129 1/6/2025
1.1.6.3 128 1/2/2025
1.1.6.2 136 12/25/2024
1.1.6.1 130 12/24/2024
1.1.5.6 131 12/19/2024
1.1.5.5 133 12/9/2024
1.1.5.4 139 12/4/2024
1.1.5.3 147 11/29/2024
1.1.5.2 137 11/28/2024
1.1.5.1 126 11/20/2024
1.1.4.38 134 11/16/2024
1.1.4.36 135 11/7/2024
1.1.4.35 128 11/7/2024
1.1.4.34 156 11/4/2024
1.1.4.33 145 11/4/2024
1.1.4.32 148 11/3/2024