![]() |
VOOZH | about |
dotnet add package GoesSoftware.SuperSDK.App --version 7.23.7
NuGet\Install-Package GoesSoftware.SuperSDK.App -Version 7.23.7
<PackageReference Include="GoesSoftware.SuperSDK.App" Version="7.23.7" />
<PackageVersion Include="GoesSoftware.SuperSDK.App" Version="7.23.7" />Directory.Packages.props
<PackageReference Include="GoesSoftware.SuperSDK.App" />Project file
paket add GoesSoftware.SuperSDK.App --version 7.23.7
#r "nuget: GoesSoftware.SuperSDK.App, 7.23.7"
#:package GoesSoftware.SuperSDK.App@7.23.7
#addin nuget:?package=GoesSoftware.SuperSDK.App&version=7.23.7Install as a Cake Addin
#tool nuget:?package=GoesSoftware.SuperSDK.App&version=7.23.7Install as a Cake Tool
using SApp = SuperSDK.App.SuperApp;
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
SApp.Initialize(config =>
{
config.AppInfo = new SuperSDK.Core.AppInfo
{
ProductName = "My App",
Version = "1.0.0",
IconPath = "avares://YourApp/app.ico"
};
config.UseBuiltInLogger(showOnStartup: false);
config.UseSqlDebug(showOnStartup: false);
config.RegisterEntity<YourEntity>();
});
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
desktop.ShutdownRequested += (s, e) => SApp.Cleanup();
}
base.OnFrameworkInitializationCompleted();
}
}
// 日志
SApp.LogInfo("信息");
SApp.LogWarning("警告");
SApp.LogError("错误");
// 窗口
SApp.ToggleLogger(); // Logger 窗口
SApp.ToggleSqlDebug(); // SQL Debug 窗口
SApp.ShowAbout(); // About 窗口
// 主题切换(默认暗黑模式)
SApp.ToggleTheme(); // 切换 Dark/Light 主题
在 .csproj 中添加:
<ItemGroup>
<AvaloniaResource Include="app.ico" />
</ItemGroup>
在 Initialize 中通过 config.AddRequest / config.AddPublish 添加启动任务,MainWindow 打开后自动执行:
SApp.Initialize(config =>
{
config.AppInfo = new SuperSDK.Core.AppInfo { ... };
// 添加启动任务(按顺序执行,自动显示进度条)
config.AddRequest<LoadConfigReq>(new LoadConfigReq(), "Loading configuration...");
config.AddRequest<InitDatabaseReq>(new InitDatabaseReq(), "Initializing database...");
config.AddPublish(new CacheWarmupMsg(), "Warming up cache...");
});
AddRequest<TReq>(request, statusText) — 发送请求并等待 handler 完成,handler 需返回 GzSplashResultAddPublish<T>(message, statusText) — 发布消息,立即完成AddTask(Func<Task>, statusText) — 自定义异步任务Splash 会持续监听 GzSplashStatusMsg,任何地方发布该消息都会实时更新进度条下方的状态文字:
MessageBus.Pub(new GzSplashStatusMsg { Text = "Connecting to server..." });
Handler 注册示例(在任何模块中):
MessageBus.RegisterReqHandler<LoadConfigReq, GzSplashResult>(this, async req =>
{
await LoadConfig();
return new GzSplashResult();
});
将自定义窗口纳入 SuperApp 统一管理,Cleanup() 时自动关闭,ToggleTheme() 时自动同步主题。
要求: 窗口必须继承 GzWindow(来自 SuperSDK.UI.Views)。
using SuperSDK.UI.Views;
// 继承 GzWindow 而非 Window
public partial class MyToolWindow : GzWindow
{
public MyToolWindow()
{
InitializeComponent();
// 若此窗口关闭时应隐藏而非销毁,拦截 Closing 事件
Closing += (s, e) =>
{
if (AllowClose) return; // Cleanup() 会设置 AllowClose=true 后再关闭
e.Cancel = true;
Hide();
};
}
}
// 注册托管
var myWindow = new MyToolWindow();
SApp.AddManagedUI(myWindow);
// 不再需要时取消注册(可选,Cleanup 会自动处理)
SApp.RemoveManagedUI(myWindow);
AllowClose 默认为 false;Cleanup() 会先将其设为 true 再调用 Close(),保证拦截逻辑不会阻止退出。Closing 事件,继承 GzWindow 即可。| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on GoesSoftware.SuperSDK.App:
| Package | Downloads |
|---|---|
|
GoesSoftware.SuperSDK.Plot
SuperSDK 绘图与数据分析 UI 组件库 - 数据表格、SPC 图表、曲线绘制等 |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.23.7 | 116 | 5/22/2026 |
| 7.23.6 | 112 | 5/22/2026 |
| 7.23.5 | 119 | 5/13/2026 |
| 7.23.4 | 115 | 5/13/2026 |
| 7.23.3 | 118 | 5/13/2026 |
| 7.23.2 | 112 | 5/13/2026 |
| 7.23.1 | 120 | 5/12/2026 |
| 7.23.0 | 115 | 5/12/2026 |
| 7.21.0 | 119 | 5/12/2026 |
| 7.20.0 | 117 | 5/12/2026 |
| 7.19.1 | 122 | 5/11/2026 |
| 7.19.0 | 112 | 5/11/2026 |
| 7.18.0 | 109 | 4/30/2026 |
| 7.17.0 | 123 | 4/29/2026 |
| 7.16.2 | 125 | 4/14/2026 |
| 7.16.0 | 123 | 4/13/2026 |
| 7.15.10 | 117 | 4/13/2026 |
| 7.15.6 | 112 | 4/13/2026 |
| 7.15.5 | 116 | 4/12/2026 |
| 7.15.1 | 115 | 4/12/2026 |
docs(gotest-agent): add Profile file naming rule to engineer prompt