Bee.UI.Core
4.1.0
dotnet add package Bee.UI.Core --version 4.1.0
NuGet\Install-Package Bee.UI.Core -Version 4.1.0
<PackageReference Include="Bee.UI.Core" Version="4.1.0" />
<PackageVersion Include="Bee.UI.Core" Version="4.1.0" />
<PackageReference Include="Bee.UI.Core" />
paket add Bee.UI.Core --version 4.1.0
#r "nuget: Bee.UI.Core, 4.1.0"
#:package Bee.UI.Core@4.1.0
#addin nuget:?package=Bee.UI.Core&version=4.1.0
#tool nuget:?package=Bee.UI.Core&version=4.1.0
Bee.UI.Core
Client-side bridging layer for Bee.NET UI applications. Bee.UI.Core wraps Bee.Api.Client connectors with a single static entry point (ClientInfo) that manages connection settings, login state, and definition-data access — letting WinForms / WPF / Avalonia hosts focus on views instead of plumbing.
Targets net10.0.
✨ Features
- One-line bootstrap:
ClientInfo.Initialize(...)resolves the saved endpoint, validates it, falls back to a connection setup view when missing, and primes the API connector. - Local & remote connection abstraction: Switch between local (file-based define path) and remote (JSON-RPC URL) by changing the endpoint string; the rest of the API surface is unchanged.
- Connector caching:
SystemApiConnectorandIDefineAccessare cached per token; resetting the access token automatically invalidates them. - Pluggable persistence: Replace the default
EndpointStorage(XML-backed<exe>.Settings.xml) with your ownIEndpointStorageimplementation. - Host-supplied UI: Connection-settings dialogs are abstracted behind
IUIViewService, leaving the choice of UI framework to the consumer.
📦 Installation
dotnet add package Bee.UI.Core
Or in .csproj:
<PackageReference Include="Bee.UI.Core" Version="4.1.0" />
This package depends on:
| Package | Version |
|---|---|
Bee.Api.Client |
4.1.0 |
(Transitively pulls in Bee.Base, Bee.Definition, Bee.Api.Core, Bee.Api.Contracts.)
🚀 Quick Start
1. Implement the host UI service
IUIViewService is invoked when the saved endpoint is missing or unreachable, prompting the user to configure a new one.
using Bee.UI.Core;
public class MainFormUIViewService : IUIViewService
{
public bool ShowApiConnect()
{
using var dialog = new ApiConnectDialog();
return dialog.ShowDialog() == DialogResult.OK;
}
}
2. Initialize on startup
using Bee.UI.Core;
using Bee.Api.Client;
// At application startup:
if (!ClientInfo.Initialize(new MainFormUIViewService(), SupportedConnectTypes.Both))
{
// User cancelled the connection setup — exit.
return;
}
Or directly with a known endpoint (no UI fallback):
ClientInfo.Initialize("http://localhost:5000/jsonrpc/api");
3. Apply the login result
After a successful login through SystemApiConnector, hand the response to ClientInfo to populate the access token and user info:
var response = await ClientInfo.SystemApiConnector.LoginAsync(userId, password);
ClientInfo.ApplyLoginResult(response);
4. Use the connectors
// System-level connector (cached per token):
var system = ClientInfo.SystemApiConnector;
// Form-level connector for a specific program:
var employee = ClientInfo.CreateFormApiConnector("Employee");
// Definition data access:
var formSchema = ClientInfo.DefineAccess.GetFormSchema("Employee");
🔧 Customization
Replace the endpoint storage
The default EndpointStorage persists to <ExeName>.Settings.xml next to the executable. To use a different backend (registry, environment variable, in-memory, etc.) supply your own implementation before Initialize:
public class EnvVarEndpointStorage : IEndpointStorage
{
public string LoadEndpoint() => Environment.GetEnvironmentVariable("API_ENDPOINT") ?? "";
public void SetEndpoint(string endpoint) { /* ... */ }
public void SaveEndpoint(string endpoint) => Environment.SetEnvironmentVariable("API_ENDPOINT", endpoint);
}
ClientInfo.EndpointStorage = new EnvVarEndpointStorage();
ClientInfo.Initialize(uiViewService, SupportedConnectTypes.Both);
Override the endpoint via command line
Initialize(IUIViewService, SupportedConnectTypes) parses Key=Value pairs from the command line. Pass Endpoint=... to override the saved endpoint at launch:
MyApp.exe Endpoint=http://staging.example.com/jsonrpc/api
The parsed dictionary is exposed through ClientInfo.Arguments.
🧩 Public API at a glance
| Member | Purpose |
|---|---|
ClientInfo.Initialize(IUIViewService, SupportedConnectTypes) |
Bootstrap from saved settings with UI fallback |
ClientInfo.Initialize(string endpoint) |
Bootstrap with an explicit endpoint |
ClientInfo.SetEndpoint(string) / GetEndpoint() |
Switch the active endpoint at runtime |
ClientInfo.ApplyLoginResult(LoginResponse) |
Apply the login response (token + user info) |
ClientInfo.SystemApiConnector |
System-level connector (auto-cached) |
ClientInfo.CreateFormApiConnector(progId) |
Form-level connector for a specific program |
ClientInfo.DefineAccess |
Remote definition-data accessor |
ClientInfo.UserInfo / AccessToken |
Authenticated user state |
IUIViewService |
Contract for the host application's view service |
IEndpointStorage / EndpointStorage |
Endpoint persistence contract & default impl |
VersionInfo |
Version / product metadata of the entry assembly |
🌐 Bee.NET Ecosystem
| Repository | Role |
|---|---|
| bee-library | Core framework (Bee.Base, Bee.Definition, Bee.Api.*, Bee.Business, …) |
| bee-jsonrpc-sample | End-to-end JSON-RPC server / client samples |
| bee-ui-core (this repo) | UI-side connection state & connector plumbing |
📬 Contact
Facebook | HackMD | GitHub | NuGet
📄 License
MIT © Bee.NET
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Bee.Api.Client (>= 4.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bee.UI.Core:
| Package | Downloads |
|---|---|
|
Bee.UI.WinForms
UI components and layout management for WinForms. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.0 | 82 | 5/6/2026 |
| 4.0.1 | 124 | 4/10/2026 |
| 3.6.2 | 250 | 11/7/2025 |
| 3.6.1 | 218 | 10/28/2025 |
| 3.6.0 | 163 | 10/24/2025 |
| 3.5.2 | 207 | 10/15/2025 |
| 3.5.1 | 204 | 10/5/2025 |
| 3.5.0 | 214 | 9/25/2025 |
| 3.4.9 | 217 | 9/25/2025 |
| 3.4.8 | 270 | 9/24/2025 |
| 3.4.7 | 196 | 9/23/2025 |
| 3.4.6 | 225 | 9/22/2025 |
| 3.4.5 | 247 | 9/22/2025 |
| 3.4.4 | 231 | 9/22/2025 |
| 3.4.3 | 188 | 9/21/2025 |
| 3.4.2 | 331 | 9/18/2025 |
| 3.4.1 | 328 | 9/16/2025 |
| 3.4.0 | 170 | 9/5/2025 |
| 3.3.1 | 210 | 9/4/2025 |
| 3.3.0 | 197 | 9/3/2025 |