![]() |
VOOZH | about |
dotnet add package DSoft.System.Mvvm.UI.WinUI --version 3.6.2606.131
NuGet\Install-Package DSoft.System.Mvvm.UI.WinUI -Version 3.6.2606.131
<PackageReference Include="DSoft.System.Mvvm.UI.WinUI" Version="3.6.2606.131" />
<PackageVersion Include="DSoft.System.Mvvm.UI.WinUI" Version="3.6.2606.131" />Directory.Packages.props
<PackageReference Include="DSoft.System.Mvvm.UI.WinUI" />Project file
paket add DSoft.System.Mvvm.UI.WinUI --version 3.6.2606.131
#r "nuget: DSoft.System.Mvvm.UI.WinUI, 3.6.2606.131"
#:package DSoft.System.Mvvm.UI.WinUI@3.6.2606.131
#addin nuget:?package=DSoft.System.Mvvm.UI.WinUI&version=3.6.2606.131Install as a Cake Addin
#tool nuget:?package=DSoft.System.Mvvm.UI.WinUI&version=3.6.2606.131Install as a Cake Tool
Provides Win UI 3 platform implementations for DSoft.System.Mvvm.UI
IPlatformCoreUIProviderThe UI static class provides four methods as defined in the IPlatformCoreUIProvider interface.
ShowAlert(string title, string message)
ShowConfirmation(string title, string message)
InvokeOnUIThread(Action)
InvokeOnUIThreadAsync(Action)
The standard UI functions can be called directly after adding the DSoft.Mvvm.UI package to your shared code
using System.Mvvm;
...
var result = await UI.ShowConfirmationDialogAsync("Confirm this", "This is a platform specific confirmation message");
if (result)
await UI.ShowAlertAsync("YAY!", "You confirmed that");
In the WinUI application project that contains the App class(or other sub-class of Application) to the application, add the DSoft.System.Mvvm.UI.WinUI package.
Call the MvvmManager.Init method in the application code, such as App constructor.
using System.Mvvm;
...
public partial class App : Application
{
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
MvvmManager.Init();
}
}
Instead of using the static UI class you can use dependency injection to access the platform implementation of IPlatformCoreUIProvider using extensions for IServiceCollection provided by the platform specific packages.
After adding DSoft.System.Mvvm.UI.WinUI to the application project you can register the core UI implementations of IPlatformCoreUIProvider with the ServiceProvider during configuration of the services using the AddCoreUI extension method.
using System.Mvvm;
...
public partial class App : Application
{
public App()
{
this.InitializeComponent();
ServiceHost.Host = new HostBuilder()
.ConfigureServices(ConfigureServices)
.Build();
}
void ConfigureServices(HostBuilderContext ctx, IServiceCollection services)
{
services.AddCoreUI();
}
}
Once the core UI is registered you can use IPlatformCoreUIProvider with dependency injection in class constructors.
using System.Mvvm;
...
public class SharedClassToDoThingsIn
{
private readonly IPlatformCoreUIProvider _coreUIProvider;
public SharedClassToDoThingsIn(IPlatformCoreUIProvider coreUIProvider)
{
_coreUIProvider = coreUIProvider;
}
public async Task SayHello()
{
await _coreUIProvider.ShowAlertAsync("Congrats", "You called the ICoreUIProvider instance");
}
}
Use can also retrieve the implementation directly from the services provider or ServiceHost if you are using DSoft.System.Mvvm.Hosting
using System.Mvvm;
...
var _coreUIProvider = ServiceHost.GetRequiredService<IPlatformCoreUIProvider>();
await _coreUIProvider.ShowAlertAsync("Congrats", "You called the ICoreUIProvider instance");
Using DI instead of the UI does not require a call to MvvmManager.Init though you do have to call the extension method to register the services. You can also use both.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.19041 net10.0-windows10.0.19041 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.2606.131 | 85 | 6/13/2026 |
| 3.5.2604.111 | 118 | 4/11/2026 |
| 3.5.2511.161 | 308 | 11/16/2025 |
| 3.4.2511.61 | 264 | 11/6/2025 |
| 3.4.2506.231 | 277 | 6/23/2025 |
| 3.4.2411.191 | 272 | 11/19/2024 |
| 3.4.2406.251 | 277 | 6/25/2024 |
| 3.3.2405.241 | 264 | 5/24/2024 |
| 3.3.2405.21 | 283 | 5/5/2024 |
| 3.2.2301.91 | 572 | 1/9/2023 |
| 3.1.2208.151 | 586 | 8/15/2022 |
| 3.1.2205.231 | 603 | 5/23/2022 |
| 3.1.2205.52-beta1 | 360 | 5/5/2022 |
| 3.0.2202.121 | 637 | 2/12/2022 |
| 3.0.2111.271-prerelease | 401 | 11/27/2021 |
Updated to .NET 10 and latest packages. Removed .NET 8 and .NET 9 support. Performance improvements.