ColorVision.Themes 1.4.1.1

dotnet add package ColorVision.Themes --version 1.4.1.1
                    
NuGet\Install-Package ColorVision.Themes -Version 1.4.1.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.4.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ColorVision.Themes" Version="1.4.1.1" />
                    
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.4.1.1
                    
#r "nuget: ColorVision.Themes, 1.4.1.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.4.1.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.4.1.1
                    
Install as a Cake Addin
#tool nuget:?package=ColorVision.Themes&version=1.4.1.1
                    
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 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.4.1.1 78 2/3/2026
1.3.10.1 107 1/14/2026
1.3.8.3 302 10/17/2025
1.3.8.2 203 9/30/2025
1.3.8.1 242 9/25/2025
1.3.7.1 241 9/21/2025
1.3.6.1 183 9/5/2025
1.3.5.1 275 8/24/2025
1.3.4.1 188 8/18/2025
1.3.2.2 241 6/3/2025
1.3.2.1 194 6/2/2025
1.3.1.1 188 5/29/2025
1.2.4.1 196 5/26/2025
1.2.3.4 187 5/23/2025
1.2.3.3 187 5/22/2025
1.2.3.2 204 5/19/2025
1.2.3.1 274 5/12/2025
1.2.1.1 197 5/6/2025
1.1.12.2 207 4/9/2025
1.1.12.1 207 4/2/2025
1.1.11.5 221 3/22/2025
1.1.11.4 197 3/20/2025
1.1.11.3 206 3/13/2025
1.1.11.1 191 3/3/2025
1.1.10.7 186 2/21/2025
1.1.10.6 171 2/20/2025
1.1.10.5 172 2/14/2025
1.1.10.4 157 2/12/2025
1.1.10.3 176 2/12/2025
1.1.10.2 160 2/12/2025
1.1.10.1 152 2/11/2025
1.1.9.29 179 2/7/2025
1.1.9.28 166 2/6/2025
1.1.9.27 153 2/6/2025
1.1.9.26 156 2/5/2025
1.1.9.25 145 1/24/2025
1.1.9.24 142 1/22/2025
1.1.9.23 163 1/21/2025
1.1.9.22 154 1/21/2025
1.1.9.21 161 1/21/2025
1.1.9.20 178 1/20/2025
1.1.9.19 153 1/17/2025
1.1.9.18 127 1/15/2025
1.1.9.17 129 1/14/2025
1.1.9.16 139 1/14/2025
1.1.9.15 147 1/13/2025
1.1.9.14 127 1/13/2025
1.1.9.13 140 1/13/2025
1.1.9.12 147 1/13/2025
1.1.9.11 142 1/13/2025
1.1.9.10 161 1/13/2025
1.1.9.8 155 1/13/2025
1.1.9.7 161 1/10/2025
1.1.9.6 130 1/8/2025
1.1.9.5 149 1/8/2025
1.1.9.4 159 1/6/2025
1.1.9.3 164 1/6/2025
1.1.9.2 156 1/6/2025
1.1.9.1 162 1/6/2025
1.1.6.3 150 1/2/2025
1.1.6.2 162 12/25/2024
1.1.6.1 148 12/24/2024
1.1.5.6 158 12/19/2024
1.1.5.5 152 12/9/2024
1.1.5.4 159 12/4/2024
1.1.5.3 171 11/29/2024
1.1.5.2 163 11/28/2024
1.1.5.1 153 11/20/2024
1.1.4.38 155 11/16/2024
1.1.4.36 159 11/7/2024
1.1.4.35 157 11/7/2024
1.1.4.34 181 11/4/2024
1.1.4.33 167 11/4/2024
1.1.4.32 180 11/3/2024