Tuna.Runtime 1.0.0.1

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

Tuna.Runtime

概述

Tuna.Runtime 提供运行时支持,主要面向 WPF 资源的集中注入与管理,帮助在 Revit 插件中统一使用样式、控件模板与资源字典。

功能亮点

  • ResourcesInjection:从指定程序集加载并注入 AppResources.xaml
  • ApplicationSource:提供全局 ResourceDictionary,作为统一资源入口
  • ApplicationSourceAttribute:可在程序集级配置资源路径
  • 自动窗口级注入:在窗口与其可视树加载时自动合并资源

使用方式

1. 准备资源文件

  • 在你的 UI 程序集内添加 WPF 资源字典,例如 AppResources.xaml(Build Action 设为 Resource)

2. 可选:通过属性指定资源路径

using Tuna.Runtime.Resources;

// 在你的 UI 程序集 AssemblyInfo.cs 或任意文件的程序集级位置添加
[assembly: ApplicationSource("AppResources.xaml")]

3. 在应用启动时注入资源

using System.Reflection;
using Tuna.Runtime.Resources;
using Tuna.Revit.Infrastructure.ApplicationServices;

namespace Samples
{
    /// <summary>
    /// 示例应用:在启动时注入资源
    /// </summary>
    public class SampleApplication : TunaApplication
    {
        /// <summary>
        /// 应用组件初始化
        /// </summary>
        public override void InitailizeComponents()
        {
            // 假设资源位于当前应用程序集
            var assembly = GetType().Assembly;
            ResourcesInjection.Initialize(assembly);
        }
    }
}

适用场景

  • 插件中统一管理样式与控件模板
  • 跨窗口共享资源字典,无需手动合并
  • 与 Tuna.Revit.Infrastructure 协同,在应用生命周期中完成资源注入
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. 
.NET Framework net452 is compatible.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Tuna.Runtime:

Package Downloads
Tuna.Revit.Infrastructure

Infrastructure abstractions and base implementations for Tuna Revit Toolkit

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.1 41 12/31/2025