Jack251970.SuGarToolkit.Controls.Dialogs
2.0.1
Suggested Alternatives
dotnet add package Jack251970.SuGarToolkit.Controls.Dialogs --version 2.0.1
NuGet\Install-Package Jack251970.SuGarToolkit.Controls.Dialogs -Version 2.0.1
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="Jack251970.SuGarToolkit.Controls.Dialogs" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jack251970.SuGarToolkit.Controls.Dialogs" Version="2.0.1" />
<PackageReference Include="Jack251970.SuGarToolkit.Controls.Dialogs" />
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 Jack251970.SuGarToolkit.Controls.Dialogs --version 2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jack251970.SuGarToolkit.Controls.Dialogs, 2.0.1"
#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 Jack251970.SuGarToolkit.Controls.Dialogs@2.0.1
#: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=Jack251970.SuGarToolkit.Controls.Dialogs&version=2.0.1
#tool nuget:?package=Jack251970.SuGarToolkit.Controls.Dialogs&version=2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WindowedContentDialog and MessageBox
WindowedContentDialog: Show ContentDialog in separate window.
MessageBox: Show MessageBox in WinUI 3 Style.
Using in {code-behind}
Using 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
};
ContentDialogResult result = await dialog.ShowAsync();
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;
Using similarly to MessageBox in WPF or WinForm
MessageBoxResult result = await MessageBox.ShowAsync(
modal: true,
App.Current.MainWindow,
"YourMessage",
"YourTitle",
MessageBoxButtons.YesNoCancel,
MessageBoxDefaultButton.Button3);
Using in < XAML />
xmlns:dialogs="using:SuGarToolkit.Controls.Dialogs"
Using WindowedContentDialog in <Page.Resources>
<Page.Resources>
<dialogs:WindowedContentDialog
x:Key="XamlWindowedContentDialog"
x:Name="XamlWindowedContentDialog"
CloseButtonText="{x:Bind settings.CloseButtonText, Mode=OneWay}"
DefaultButton="{x:Bind settings.DefaultButton, Mode=OneWay}"
IsModal="{x:Bind settings.IsModal, Mode=OneWay}"
IsPrimaryButtonEnabled="{x:Bind settings.IsPrimaryButtonEnabled, Mode=OneWay}"
IsSecondaryButtonEnabled="{x:Bind settings.IsSecondaryButtonEnabled, Mode=OneWay}"
OwnerWindow="{x:Bind app:App.Current.MainWindow}"
PrimaryButtonText="{x:Bind settings.PrimaryButtonText, Mode=OneWay}"
SecondaryButtonText="{x:Bind settings.SecondaryButtonText, Mode=OneWay}"
SmokeBehind="{x:Bind settings.SmokeBehind, Mode=OneWay}">
<dialogs:WindowedContentDialog.SystemBackdrop>
<MicaBackdrop />
</dialogs:WindowedContentDialog.SystemBackdrop>
<dialogs:WindowedContentDialog.Title>
<dialogs:MessageBoxHeader Icon="Information" Text="{x:Bind settings.Title, Mode=OneWay}" />
</dialogs:WindowedContentDialog.Title>
<StackPanel>
<CheckBox Content="Lorem" IsThreeState="True" />
<CheckBox Content="Ipsum" IsThreeState="True" />
<CheckBox Content="Dolor" IsThreeState="True" />
<CheckBox Content="Sit" IsThreeState="True" />
<CheckBox Content="Amet" IsThreeState="True" />
</StackPanel>
</dialogs:WindowedContentDialog>
</Page.Resources>
Using FlyoutContentDialog in <Page.Resources>
<Page.Resources>
<dialogs:FlyoutContentDialog
x:Key="XamlFlyoutContentDialog"
x:Name="XamlFlyoutContentDialog"
CloseButtonText="{x:Bind settings.CloseButtonText, Mode=OneWay}"
IsPrimaryButtonEnabled="{x:Bind settings.IsPrimaryButtonEnabled, Mode=OneWay}"
IsSecondaryButtonEnabled="{x:Bind settings.IsSecondaryButtonEnabled, Mode=OneWay}"
PlacementTarget="{x:Bind ShowContentDialogButton}"
PrimaryButtonText="{x:Bind settings.PrimaryButtonText, Mode=OneWay}"
SecondaryButtonText="{x:Bind settings.SecondaryButtonText, Mode=OneWay}"
SmokeBehind="{x:Bind settings.SmokeBehind, Mode=OneWay}">
<dialogs:FlyoutContentDialog.Title>
<dialogs:MessageBoxHeader Icon="Information" Text="{x:Bind settings.Title, Mode=OneWay}" />
</dialogs:FlyoutContentDialog.Title>
<StackPanel>
<CheckBox Content="Lorem" IsThreeState="True" />
<CheckBox Content="Ipsum" IsThreeState="True" />
<CheckBox Content="Dolor" IsThreeState="True" />
<CheckBox Content="Sit" IsThreeState="True" />
<CheckBox Content="Amet" IsThreeState="True" />
</StackPanel>
</dialogs:FlyoutContentDialog>
</Page.Resources>
Using ContentDialogWindow in XAML
<dialogs:ContentDialogWindow
x:Class="SuGarToolkit.Sample.Dialogs.Views.SampleContentDialogWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dialogs="using:SuGarToolkit.Controls.Dialogs"
xmlns:local="using:SuGarToolkit.Sample.Dialogs.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Sample ContentDialogWindow"
CloseButtonText="Close Button"
DefaultButton="Primary"
DialogTitle="{x:Bind Title}"
PrimaryButtonText="Primary Button"
SecondaryButtonText="Secondary Button"
mc:Ignorable="d">
<dialogs:ContentDialogWindow.SystemBackdrop>
<MicaBackdrop />
</dialogs:ContentDialogWindow.SystemBackdrop>
<StackPanel>
<CheckBox Content="Using" IsThreeState="True" />
<CheckBox Content="ContentDialogWindow" IsChecked="True" />
<CheckBox Content="in XAML" IsThreeState="True" />
<TextBox
AcceptsReturn="True"
FontFamily="Consolas"
IsReadOnly="True"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Text="{x:Bind local:SampleContentDialogWindow.XamlCode}" />
</StackPanel>
</dialogs:ContentDialogWindow>
Using ContentDialogFlyout as Button.Flyout
<Button Content="ContentDialogFlyout">
<Button.Flyout>
<dialogs:ContentDialogFlyout
CloseButtonText="Close Button"
DefaultButton="Primary"
DialogTitle="Sample ContentDialogFlyout"
PrimaryButtonText="Primary Button"
RequestedTheme="{x:Bind ActualTheme}"
SecondaryButtonText="Secondary Button">
<StackPanel>
<CheckBox Content="Using" IsThreeState="True" />
<CheckBox Content="ContentDialogFlyout" IsChecked="True" />
<CheckBox Content="in XAML" IsThreeState="True" />
<TextBox
AcceptsReturn="True"
FontFamily="Consolas"
IsReadOnly="True"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Text="{x:Bind local:ContentDialogFlyoutSamplePage.XamlCode}" />
</StackPanel>
</dialogs:ContentDialogFlyout>
</Button.Flyout>
</Button>
| Product | Versions 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.
-
net8.0-windows10.0.19041
- Microsoft.Windows.CsWinRT (>= 2.2.0)
- Microsoft.WindowsAppSDK (>= 1.7.250606001)
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.0.1 | 335 | 9/30/2025 |