{"id":25978392,"url":"https://github.com/jamesnetgroup/jamesnet.foundation","last_synced_at":"2025-08-29T16:23:46.223Z","repository":{"id":280415688,"uuid":"898703492","full_name":"JamesnetGroup/jamesnet.foundation","owner":"JamesnetGroup","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-08T19:25:27.000Z","size":3217,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-08T20:33:03.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesnetGroup.png","metadata":{"files":{"readme":"README.cn.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["jamesnet214","vickyqu115"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-12-04T21:55:17.000Z","updated_at":"2025-08-08T19:25:31.000Z","dependencies_parsed_at":"2025-03-03T10:29:13.787Z","dependency_job_id":"afb2e122-ca2f-4524-a15f-ffa7f3331a6f","html_url":"https://github.com/JamesnetGroup/jamesnet.foundation","commit_stats":null,"previous_names":["jamesnetgroup/jamesnet.foundation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JamesnetGroup/jamesnet.foundation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesnetGroup%2Fjamesnet.foundation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesnetGroup%2Fjamesnet.foundation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesnetGroup%2Fjamesnet.foundation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesnetGroup%2Fjamesnet.foundation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesnetGroup","download_url":"https://codeload.github.com/JamesnetGroup/jamesnet.foundation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesnetGroup%2Fjamesnet.foundation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272718554,"owners_count":24981491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-05T05:20:13.854Z","updated_at":"2025-08-29T16:23:46.215Z","avatar_url":"https://github.com/JamesnetGroup.png","language":"C#","funding_links":["https://github.com/sponsors/jamesnet214","https://github.com/sponsors/vickyqu115"],"categories":[],"sub_categories":[],"readme":"# Jamesnet.Foundation\n\n`Jamesnet.Foundation` is a core library that provides common functionality across various platforms. It is referenced by several platform-specific projects, which utilize its essential features.\n\n[![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Foundation.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Foundation/)  [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Foundation.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Foundation/)\n\n\u003e **Note:** NuGet publish date information is not available, so it is not included.\n\n## Supported Platforms\n\n- **[Jamesnet.Platform.OpenSilver](https://www.nuget.org/packages/Jamesnet.Platform.OpenSilver/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.OpenSilver.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.OpenSilver/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.OpenSilver.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.OpenSilver/)\n- **[Jamesnet.Platform.Wpf](https://www.nuget.org/packages/Jamesnet.Platform.Wpf/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.Wpf.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Wpf/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.Wpf.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Wpf/)\n- **[Jamesnet.Platform.Uno](https://www.nuget.org/packages/Jamesnet.Platform.Uno/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.Uno.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uno/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.Uno.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uno/)\n- **[Jamesnet.Platform.Uwp](https://www.nuget.org/packages/Jamesnet.Platform.Uwp/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.Uwp.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uwp/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.Uwp.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uwp/)\n- **[Jamesnet.Platform.WinUI3](https://www.nuget.org/packages/Jamesnet.Platform.WinUI3/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.WinUI3.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.WinUI3/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.WinUI3.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.WinUI3/)\n\n## Installation\n\nInstall the package using the NuGet Package Manager:\n\n```powershell\nInstall-Package Jamesnet.Foundation\n```\n\nFor WPF projects, you should also install the following package:\n\n```powershell\nInstall-Package Jamesnet.Platform.Wpf\n```\n\n## Usage\n\n`Jamesnet.Foundation` supports application initialization through the `AppBootstrapper` class. The following example demonstrates how to extend `AppBootstrapper` in a WPF project for initialization.\n\n\u003e **Note:** There is no need to explain the `virtual` keyword or the old `SetMainWindow` approach.\n\n### Example: Using AppBootstrapper in a WPF Project\n\n```csharp\nusing Jamesnet.Foundation;\nusing Jamesnet.Platform.Wpf; // WPF platform package reference\n\nnamespace MyApp\n{\n    public class MyAppBootstrapper : AppBootstrapper\n    {\n        protected override void RegisterViewModels()\n        {\n            // Map the view to the view model.\n            ViewModelMapper.Register\u003cMainContent, MainViewModel\u003e();\n        }\n\n        protected override void RegisterDependencies(IContainer container)\n        {\n            // Register MainContent as the IView implementation with the key \"MainContent\".\n            Container.RegisterSingleton\u003cIView, MainContent\u003e(\"MainContent\");\n        }\n\n        protected override void SettingsLayer(ILayerManager layer, IContainer container)\n        {\n            // Perform mapping using the \"Main\" key.\n            Mapping(\"Main\", container.Resolve\u003cIView\u003e(\"MainContent\"));\n        }\n    }\n\n    public partial class App : Application\n    {\n        protected override void OnStartup(StartupEventArgs e)\n        {\n            base.OnStartup(e);\n            var bootstrapper = new MyAppBootstrapper();\n            bootstrapper.Run(); // Execute application initialization\n        }\n    }\n}\n```\n\nIn this example:\n\n- **Dependency Registration:**    `Container.RegisterSingleton\u003cIView, MainContent\u003e(\"MainContent\");` registers `MainContent` as an implementation of the `IView` interface with the key `\"MainContent\"`.\n- **View-ViewModel Mapping:**    `ViewModelMapper.Register\u003cMainContent, MainViewModel\u003e();` maps the `MainContent` view to the `MainViewModel`.\n- **Layer Settings:**    `Mapping(\"Main\", container.Resolve\u003cIView\u003e(\"MainContent\"));` sets up the mapping for the \"Main\" layer using the registered view.\n\n---\n\n**中文版本**\n\n# Jamesnet.Foundation\n\n`Jamesnet.Foundation` 是一个提供跨多个平台通用功能的核心库。多个平台特定项目都引用了该库，并利用其基本功能。\n\n[![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Foundation.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Foundation/)  [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Foundation.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Foundation/)\n\n\u003e **注意：** NuGet 发布日期信息不可用，因此未包含该信息。\n\n## 支持平台\n\n- **[Jamesnet.Platform.OpenSilver](https://www.nuget.org/packages/Jamesnet.Platform.OpenSilver/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.OpenSilver.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.OpenSilver/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.OpenSilver.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.OpenSilver/)\n- **[Jamesnet.Platform.Wpf](https://www.nuget.org/packages/Jamesnet.Platform.Wpf/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.Wpf.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Wpf/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.Wpf.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Wpf/)\n- **[Jamesnet.Platform.Uno](https://www.nuget.org/packages/Jamesnet.Platform.Uno/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.Uno.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uno/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.Uno.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uno/)\n- **[Jamesnet.Platform.Uwp](https://www.nuget.org/packages/Jamesnet.Platform.Uwp/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.Uwp.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uwp/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.Uwp.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.Uwp/)\n- **[Jamesnet.Platform.WinUI3](https://www.nuget.org/packages/Jamesnet.Platform.WinUI3/)**    [![NuGet Version](https://img.shields.io/nuget/v/Jamesnet.Platform.WinUI3.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.WinUI3/)    [![NuGet Downloads](https://img.shields.io/nuget/dt/Jamesnet.Platform.WinUI3.svg?style=flat-square)](https://www.nuget.org/packages/Jamesnet.Platform.WinUI3/)\n\n## 安装方法\n\n使用 NuGet 包管理器安装该软件包：\n\n```powershell\nInstall-Package Jamesnet.Foundation\n```\n\n对于 WPF 项目，还需安装以下软件包：\n\n```powershell\nInstall-Package Jamesnet.Platform.Wpf\n```\n\n## 使用方法\n\n`Jamesnet.Foundation` 通过 `AppBootstrapper` 类支持应用程序初始化。下面的示例展示了如何在 WPF 项目中扩展 `AppBootstrapper` 进行初始化。\n\n\u003e **注意：** 无需解释 `virtual` 关键字或旧的 `SetMainWindow` 方法。\n\n### 示例：在 WPF 项目中使用 AppBootstrapper\n\n```csharp\nusing Jamesnet.Foundation;\nusing Jamesnet.Platform.Wpf; // 引用 WPF 平台软件包\n\nnamespace MyApp\n{\n    public class MyAppBootstrapper : AppBootstrapper\n    {\n        protected override void RegisterViewModels()\n        {\n            // 映射视图与视图模型。\n            ViewModelMapper.Register\u003cMainContent, MainViewModel\u003e();\n        }\n\n        protected override void RegisterDependencies(IContainer container)\n        {\n            // 将 MainContent 以键 \"MainContent\" 注册为 IView 接口的实现。\n            Container.RegisterSingleton\u003cIView, MainContent\u003e(\"MainContent\");\n        }\n\n        protected override void SettingsLayer(ILayerManager layer, IContainer container)\n        {\n            // 使用 \"Main\" 键进行映射设置。\n            Mapping(\"Main\", container.Resolve\u003cIView\u003e(\"MainContent\"));\n        }\n    }\n\n    public partial class App : Application\n    {\n        protected override void OnStartup(StartupEventArgs e)\n        {\n            base.OnStartup(e);\n            var bootstrapper = new MyAppBootstrapper();\n            bootstrapper.Run(); // 执行应用程序初始化\n        }\n    }\n}\n```\n\n在此示例中：\n\n- **依赖注册：**    `Container.RegisterSingleton\u003cIView, MainContent\u003e(\"MainContent\");` 将 `MainContent` 作为 `IView` 接口的实现注册，并使用键 `\"MainContent\"`。\n- **视图-视图模型映射：**    `ViewModelMapper.Register\u003cMainContent, MainViewModel\u003e();` 将 `MainContent` 视图映射到 `MainViewModel`。\n- **图层设置：**    `Mapping(\"Main\", container.Resolve\u003cIView\u003e(\"MainContent\"));` 使用注册的视图通过键 `\"Main\"` 进行映射设置。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesnetgroup%2Fjamesnet.foundation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesnetgroup%2Fjamesnet.foundation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesnetgroup%2Fjamesnet.foundation/lists"}