VeloxDev.Core 3.3.6

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

🚀 VeloxDev

在多个.NET的UI框架中采用一致API完成常见编程任务


📚 目录


⬇️ 获取

① 若您喜欢拆箱即用的体验,从下述包列表选装即可

框架 项目 NuGet 依赖第三方库 备注
WPF VeloxDev.WPF NuGet 适配包
Avalonia VeloxDev.Avalonia NuGet 适配包
WinUI VeloxDev.WinUI NuGet 适配包
MAUI VeloxDev.MAUI NuGet 适配包
WinForms VeloxDev.WinForms NuGet 适配包
.NET VeloxDev.Core.Extension NuGet 功能扩展包

② 若您或者您的项目满足下述条件,可仅安装核心库

  1. 您更喜欢了解抽象层的结构设计与实现,并亲自实现适配层

  2. 您不打算使用 动画主题渐变切换Views交互代码生成 这些必须有适配层支持的功能

框架 项目 NuGet 依赖第三方库 备注
.NET VeloxDev.Core NuGet 核心库

✨ 概览

Examples 目录下编写了对应的 demo

功能特性 描述 是否需要适配层 说明
🪶 MVVM 自动生成NotifyProperty与Command
🔁 Workflow 可视化拖拽式工作流设计器
🎞️ Transition 跨平台的动画抽象层,支持缓动函数 需要为不同平台实现具体的插值器、主线程检测器、调度器等
🌀 AOP 面向切面编程的拦截框架 需要目标框架 ≥ .NET5
🎨 Theme 动态主题切换和样式管理 需要适配不同平台的样式/资源系统
⚙️ MonoBehaviour 按帧同步的循环刷新机制
📦 AOT - Reflect 在AOT编译项目中生成反射调用代码

🪶 MVVM Toolkit

GitHub

轻量 MVVM 工具,支持:

  • 通知属性([VeloxProperty]
  • 命令([VeloxCommand]
    public sealed partial class SlotContext
    {
        [VeloxProperty]
        private string name = string.Empty;

        partial void OnNameChanged(string oldValue,string newValue)
        {
            DeleteCommand.Notify(); // 通知命令可执行态的改变
        }

        [VeloxCommand]
        private Task Delete(object? parameter, CancellationToken ct)
        {
            // …… 此处执行你的命令逻辑
            // 可在 VeloxCommand 的参数中选择 Command名称,默认 “Auto”
            // 可在 VeloxCommand 的参数中选择是否手动验证命令可执行性
            // 可在 VeloxCommand 的参数中选择信号量以启用并发
            return Task.CompletedTask;
        }

        private void Test()
        {
            // 下述三个方法均有 Async 版本
            DeleteCommand.Execute(null); // 执行
            DeleteCommand.Interrupt();   // 取消当前执行中的 Task
            DeleteCommand.Clear();       // 取消包含排队 Task 在内的所有 Task
            
            DeleteCommand.Lock();        // 锁定命令 - 阻止新的任务开始
            DeleteCommand.UnLock();      // 解锁命令
        }
    }

⛓️ Workflow

GitHub

Workflow 生成支持

通过 Source Generator 自动生成拖拽式工作流 ViewModel 模板,它直接支持:

  • 任务散播
  • 节点挂载
  • 节点拖动
  • 任务并发、排队
  • 操作取消
  • 丰富的扩展点

🎞️ 插值动画

GitHub

您可在多个UI框架中体验到下述动画能力

  • 缓动支持(线性、缓入缓出、弹性、反弹等)
  • 循环支持
  • 回复支持
  • Fluent API
  • ThemeManager 联动支持渐变的主题切换
                var effect1 = new TransitionEffect()
                {
                    Duration = TimeSpan.FromSeconds(2),
                    LoopTime = 1,
                    FPS = 144,
                    Ease = Eases.Cubic.InOut,
                };

                effect1.Completed += (s, e) =>
                {
                    MessageBox.Show("Animation Completed");
                };

                var animation = Transition<Window>.Create()
                    .Property(w => w.Background, Brushes.Violet)
                    .Effect(effect1)
                    .Then()
                    .Property(w => w.Background, Brushes.Lime)
                    .Effect(effect1)
                    .Execute(this);

                // Transition<Window>.Execute(this);

🌀 AOP 编程

GitHub

以特性方式声明切面编程:

[AspectOriented]
public void Execute() { ... }

在编译时注入代理逻辑,支持前后置钩子与方法替换


🎨 ThemeManager

GitHub

统一的主题控制模块

  • 内置 Dark / Light 主题
  • 可选插值动画
  • 可一行特性声明多套主题
  • 主题可以自定义
    [ThemeConfig<ObjectConverter, Dark, Light>(nameof(Background), ["#1e1e1e"], ["#00ffff"])]
    [ThemeConfig<ObjectConverter, Dark, Light>(nameof(Foreground), ["#ffffff"], ["#1e1e1e"])]
    [ThemeConfig<ObjectConverter, Dark, Light>(nameof(Width), ["800"], ["400"])]
    public partial class MainWindow : Window

⚙️ MonoBehaviour

GitHub

类似游戏引擎的帧循环任务

[MonoBehaviour]
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        Loaded += (s, e) =>
        {
            InitializeMonoBehaviour();  // 每个实例都需要执行
            MonoBehaviourManager.Start();  // 全局执行一次
        };
    }

    partial void Update(FrameEventArgs e)
    {
        // 每帧更新逻辑
        UpdatePerformanceDisplay(e);
        
        // 业务逻辑处理
        if (e.DeltaTime > 100)
        {
            Debug.WriteLine("帧率过低警告");
        }
    }

    partial void Awake()
    {
        // 组件初始化逻辑
        Debug.WriteLine("组件已唤醒");
    }

    partial void Start()
    {
        // 启动逻辑
        Debug.WriteLine("组件已启动");
    }
}

📦 AOT Reflection

GitHub

💡 设计目标

在裁剪敏感的环境中保留特定类的反射资源

🧱 声明方式
using VeloxDev.Core.AOT;

[AOTReflection(Properties: true)]
public class Player
{
    public string Name { get; set; }
    public int Score;
}
⚙️ 自动生成结果

程序启动前调用生成器自动生成的 VeloxDev.Core.AOTReflection.Init()

public static void Init()
{
    _ = typeof(global::Player).GetTypeInfo();
    _ = typeof(global::Player).GetConstructors(...);
    _ = typeof(global::Player).GetProperties(...);
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on VeloxDev.Core:

Package Downloads
VeloxDev.WPF

VeloxDev.Core + WPF

VeloxDev.Avalonia

VeloxDev.Core + Avalonia

VeloxDev.MAUI

VeloxDev.Core + MAUI

VeloxDev.WinUI

VeloxDev.Core + WinUI

VeloxDev.WinForms

VeloxDev.Core + WinForms

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.3.6 258 12/21/2025