Underdog.Core 1.0.5

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

Underdog.Core

基于Prism的wpf框架

鸣谢

根据这个修改来的

开发信息

  • NET8 + VS2022
  • WPF

支持功能

  • 移植了Prism框架中的模块化、mvvm、region、dialog
  • 支持NET6、NET8及以上版本

快速使用

安装包

    dotnet add package Underdog.Core --version 1.0.5
    dotnet add package Underdog.Wpf --version 1.0.7

1.创建Program.cs文件


    public class Program
    {
        public static IHost? AppHost { get; private set; }
        public static IServiceProvider ServiceProvider => AppHost!.Services;

        [System.STAThreadAttribute()]
        public static void Main(string[] args)
        {
            var builder = Host.CreateDefaultBuilder(args)
                // 注册模块
                .ConfigureServices(ModularityExtension.AddModularity)
                .ConfigureServices((hosting,context)=>
                {
                    Assembly currentAssembly = Assembly.GetExecutingAssembly();

                    services.AddSingleton<App>();
                    services.AddScoped<MainWindow>();
                    services.AddScoped<MainWindowViewModel>();
                    services.AddRegion(); // 添加区域
                    services.AddDialog(); // 添加Dialog
                    services.AddMvvm(); // 添加MVVM
                    // 添加视图扫描器,由于region的name需要传完整视图文件所在程序集的完全限定名,提供视图扫描器获取名称
                    services.AddRegionViewScanner(currentAssembly);
                    services.AddViewsAndViewModels(currentAssembly);
                });

            AppHost = builder.Build();

            AppHost.UseRegion<MainWindow>();
            // 注册区域
            // var regionManager = AppHost.Services.GetService<IRegionManager>();
            // regionManager?.RegisterViewWithRegion("ContentRegion", typeof(ViewA));
            // regionManager?.RegisterViewWithRegion("ContentRegion", typeof(ViewB));

            // 启用模块化
            AppHost.UseModularity();

            AppHost.Run();
        }
    }

2.修改.csproj文件,指定启动对象为Program

  <PropertyGroup>
	  <StartupObject>YourNamespace.Program</StartupObject>
  </PropertyGroup>

3.修改App.xaml

删除 StartupUri="MainWindow.xaml" 属性

4.启动程序

MVVM

Dialog

Region

Modularity

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Underdog.Core:

Package Downloads
Underdog.Wpf

a wpf framework based on net core

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 224 4/6/2025
1.0.4 156 8/12/2024

支持net6.0