SuGarToolkit.Controls.Dialogs 1.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package SuGarToolkit.Controls.Dialogs --version 1.0.7
                    
NuGet\Install-Package SuGarToolkit.Controls.Dialogs -Version 1.0.7
                    
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="SuGarToolkit.Controls.Dialogs" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SuGarToolkit.Controls.Dialogs" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="SuGarToolkit.Controls.Dialogs" />
                    
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 SuGarToolkit.Controls.Dialogs --version 1.0.7
                    
#r "nuget: SuGarToolkit.Controls.Dialogs, 1.0.7"
                    
#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 SuGarToolkit.Controls.Dialogs@1.0.7
                    
#: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=SuGarToolkit.Controls.Dialogs&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=SuGarToolkit.Controls.Dialogs&version=1.0.7
                    
Install as a Cake Tool

WindowedContentDialog

Show ContentDialog in separate window.

Use similarly to ContentDialog in WinUI 3

WindowedContentDialog dialog = new()
{
    Title = "YourTitle",
    Content = "YourContent",
    PrimaryButtonText = "YourPrimaryButtonText",
    SecondaryButtonText = "YourSecondaryButtonText",
    CloseButtonText = "YourCloseButtonText",
    DefaultButton = ContentDialogButton.Primary,
    OwnerWindow = App.Current.MainWindow,
    RequestedTheme = ElementTheme.Dark
};
ContentDialogResult result = await dialog.ShowAsync(modal: true);

If you want to prevent dialog from closing after buttons clicked, please handle click event and set e.Cancel = true where e is ContentDialogWindowButtonClickEventArgs.

dialog.PrimaryButtonClick += (o, e) => e.Cancel = true;

Use similarly to MessageBox in WPF or WinForm

MessageBoxResult result = await MessageBox.ShowAsync(
    modal: true,
    App.Current.MainWindow,
    "YourMessage",
    "YourTitle",
    MessageBoxButtons.YesNoCancel,
    MessageBoxDefaultButton.Button3);

Use WindowedContentDialog in your projects

Download nupkg in Github release page.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows10.0.19041 is compatible.  net9.0-windows 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.1 213 10/8/2025
2.1.0 240 10/7/2025
2.0.1 415 10/1/2025
2.0.0 378 8/31/2025
1.2.1 170 8/22/2025
1.2.0 170 8/22/2025
1.1.1 199 8/19/2025
1.1.0 203 8/17/2025
1.0.7 125 8/16/2025
1.0.6 139 8/16/2025
1.0.5 126 8/16/2025
1.0.4 206 8/13/2025
1.0.3 204 8/11/2025
1.0.2 266 8/6/2025
1.0.1 284 8/5/2025
1.0.0 599 7/22/2025