CP.Extensions.Hosting.WinUI 2.0.5
dotnet add package CP.Extensions.Hosting.WinUI --version 2.0.5
NuGet\Install-Package CP.Extensions.Hosting.WinUI -Version 2.0.5
<PackageReference Include="CP.Extensions.Hosting.WinUI" Version="2.0.5" />
paket add CP.Extensions.Hosting.WinUI --version 2.0.5
#r "nuget: CP.Extensions.Hosting.WinUI, 2.0.5"
// Install CP.Extensions.Hosting.WinUI as a Cake Addin #addin nuget:?package=CP.Extensions.Hosting.WinUI&version=2.0.5 // Install CP.Extensions.Hosting.WinUI as a Cake Tool #tool nuget:?package=CP.Extensions.Hosting.WinUI&version=2.0.5
注意:命名空间已更改到 ReactiveMarbles.Extensions.Hosting。请更新对新的命名空间的引用。
ReactiveMarbles.Extensions.Hosting
Microsoft.Extensions.Hosting 库的扩展,旨在允许 Windows 应用程序使用托管基础。
ReactiveMarbles.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite
.UseWebHostServices((whb, services) =>
{
services.UseEntityFrameworkCoreSqlite<DBContext, IdentityUser, IdentityRole>(whb, "DefaultConnection")
.Configure<IdentityOptions>(options =>
{
// Configure options
});
})
ReactiveMarbles.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer
.UseWebHostServices((whb, services) =>
{
services.UseEntityFrameworkCoreSqlServer<DBContext, IdentityUser, IdentityRole>(whb, "DefaultConnection")
.Configure<IdentityOptions>(options =>
{
// Configure options
});
})
ReactiveMarbles.Extensions.Hosting.MainUIThread
用于在 Wpf / WinUI / WinForms 应用程序中运行主 UI 线程。
ReactiveMarbles.Extensions.Hosting.Plugins
.ConfigurePlugins(pluginBuilder =>
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Running using dotNet {0}", Environment.Version);
//// Specify the location from where the Dll's are "globbed"
var process = Process.GetCurrentProcess();
var fullPath = process.MainModule?.FileName?.Replace(process.MainModule.ModuleName!, string.Empty);
Console.WriteLine("Add Scan Directories: {0}", fullPath);
pluginBuilder?.AddScanDirectories(fullPath!);
//// Add the framework libraries which can be found with the specified globs
pluginBuilder?.IncludeFrameworks(@"\netstandard2.0\*.FrameworkLib.dll");
//// Add the plugins which can be found with the specified globs
var runtime = targetRuntime ?? Path.GetFileName(executableLocation);
Console.WriteLine(@"Include Plugins from: \Plugins\{0}\{1}*.dll", runtime, nameSpace);
pluginBuilder?.IncludePlugins(@$"\Plugins\{runtime}\{##YourPluginNameSpace##}*.dll");
Console.ResetColor();
})
/// <summary>
/// This plug-in configures the HostBuilderContext to have the hosted services
/// </summary>
public class Plugin : PluginBase<FirstService, SecondService, ThirdService>
{
}
ReactiveMarbles.ExtensionsHosting.PluginService
await ServiceHost.Create(
typeof(Program),
args,
hb => hb, // Configure the HostBuilder
host => {}, // Configure the Host
nameSpace: "ReactiveMarbles.Plugin").ConfigureAwait(false);
ReactiveMarbles.Extensions.Hosting.ReactiveUI.WinForms
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureWinForms<MainForm>()
.UseWinFormsLifetime()
ReactiveMarbles.Extensions.Hosting.ReactiveUI.WinUI
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureWinUI<MainWindow>()
.UseWpfLifetime()
ReactiveMarbles.Extensions.Hosting.ReactiveUI.Wpf
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureWpf<MainWindow>()
.UseWpfLifetime()
ReactiveMarbles.Extensions.Hosting.SingleInstance
.ConfigureSingleInstance(builder =>
{
builder.MutexId = "{ea031523-3a63-45e5-85f2-6fa75fbf37ed}";
builder.WhenNotFirstInstance = (hostingEnvironment, logger) =>
{
// Application already started, this is another instance
logger.LogWarning("Application {0} already running.", hostingEnvironment.ApplicationName);
};
})
ReactiveMarbles.Extensions.Hosting.WinForms
.ConfigureWinForms<MainForm>()
.UseWinFormsLifetime()
ReactiveMarbles.Extensions.Hosting.WinUI
.ConfigureWinUI<MainWindow>()
.UseWpfLifetime()
ReactiveMarbles.Extensions.Hosting.Wpf
.ConfigureWpf<MainWindow>()
.UseWpfLifetime()
产品 |
|
---|---|
.NET |
-
net6.0-windows10.0.17763
- CP.Extensions.Hosting.MainUIThread (>= 2.0.5)
- Microsoft.WindowsAppSDK (>= 1.5.240428000)
-
net8.0-windows10.0.17763
- CP.Extensions.Hosting.MainUIThread (>= 2.0.5)
- Microsoft.WindowsAppSDK (>= 1.5.240428000)
NuGet包 (1)
显示依赖CP.Extensions.Hosting.WinUI的前1个NuGet包
包 | 下载 |
---|---|
CP.Extensions.Hosting.ReactiveUI.WinUI
此扩展为基于dotnet core 6.0 / 8.0 WinUI应用程序的通用宿主添加了ReactiveUI支持。使用它,您可以增强应用的用户界面,并使用通用宿主提供的所有服务,如DI、日志记录等,以及这个响应式MVVM框架。 |
GitHub仓库
此包没有使用任何流行的GitHub仓库。
版本 | 下载 | 最后更新 |
---|---|---|
2.0.5 | 88 | 5/18/2024 |
1.5.2 | 93 | 5/17/2024 |
1.4.2 | 99 | 5/5/2024 |
1.3.13 | 75 | 5/1/2024 |
1.3.2 | 91 | 4/11/2024 |
1.2.2 | 85 | 3/26/2024 |
1.1.90 | 109 | 3/19/2024 |
1.1.28 | 95 | 2/5/2024 |
1.1.18 | 160 | 1/4/2024 |
1.1.11 | 110 | 12/23/2023 |
1.1.10 | 87 | 12/23/2023 |
1.1.7 | 95 | 12/14/2023 |
1.1.5 | 153 | 11/23/2023 |
1.1.3 | 102 | 11/12/2023 |
1.0.61 | 101 | 11/6/2023 |
1.0.60 | 110 | 11/6/2023 |
1.0.58 | 113 | 10/27/2023 |
1.0.56 | 129 | 10/27/2023 |
1.0.55 | 110 | 10/27/2023 |
1.0.54 | 117 | 10/27/2023 |
1.0.52 | 137 | 10/17/2023 |
1.0.50 | 116 | 10/17/2023 |
1.0.48 | 99 | 10/16/2023 |
1.0.47 | 111 | 10/16/2023 |
1.0.46 | 111 | 10/16/2023 |
1.0.44 | 118 | 10/3/2023 |
1.0.43 | 97 | 10/2/2023 |
1.0.39 | 107 | 10/2/2023 |
1.0.37 | 111 | 9/30/2023 |
1.0.33 | 107 | 9/19/2023 |
1.0.31 | 103 | 9/19/2023 |
1.0.29 | 111 | 9/14/2023 |
1.0.17 | 125 | 8/31/2023 |
1.0.15 | 120 | 8/30/2023 |
1.0.13 | 154 | 8/30/2023 |
1.0.8 | 147 | 8/1/2023 |
1.0.7 | 115 | 8/1/2023 |
1.0.6 | 140 | 7/25/2023 |
1.0.4 | 146 | 7/25/2023 |
与Net 6 / 8和net462的兼容性