MaterialDesignXaml.DialogsHelper
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MaterialDesignXaml.DialogsHelper --version 1.0.0
NuGet\Install-Package MaterialDesignXaml.DialogsHelper -Version 1.0.0
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="MaterialDesignXaml.DialogsHelper" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MaterialDesignXaml.DialogsHelper --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MaterialDesignXaml.DialogsHelper, 1.0.0"
#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.
// Install MaterialDesignXaml.DialogsHelper as a Cake Addin #addin nuget:?package=MaterialDesignXaml.DialogsHelper&version=1.0.0 // Install MaterialDesignXaml.DialogsHelper as a Cake Tool #tool nuget:?package=MaterialDesignXaml.DialogsHelper&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MaterialDesignXaml.DialogsHelper
MVVM Example:
Main ViewModel:
class MainWindowVM : IDialogIdentifier
{
public string Identifier => "RootDialog";
/// <summary>
/// DelegateCommand - DevExpressMVVM.
/// </summary>
public ICommand OpenDialogCommand => new DelegateCommand(async () =>
{
//...any works
string name = await this.Show<string>(new TestDialog(this));
MessageBox.Show($"Your name: {name}");
});
}
MainWindow View:
<Window ...>
<Window.DataContext>
<local:MainWindowVM/>
</Window.DataContext>
<materialDesign:DialogHost Identifier="{Binding Identifier}">
<Button Content="Open dialog"
Command="{Binding OpenDialogCommand}"
Height="50"
Width="100"/>
</materialDesign:DialogHost>
</Window>
TestDialog (UserControl):
public partial class TestDialog : UserControl
{
public TestDialog(IDialogIdentifier identifier)
{
InitializeComponent();
DataContext = new TestDialogVM(identifier);
}
}
TestDialog ViewModel:
class TestDialogVM : IClosableDialog
{
public TestDialogVM(IDialogIdentifier identifier)
{
Identifier = identifier;
}
/// <summary>
/// Closing dialog.
/// DelegateCommand - DevExpressMVVM.
/// </summary>
public ICommand CloseDialogCommand => new DelegateCommand<string>(name =>
{
//...any works
this.Close(name); //closing with parameter = value
});
/// <summary>
/// DialogHost owner.
/// </summary>
public IDialogIdentifier Identifier { get; set; }
}
TestDialog View:
<UserControl ...>
<StackPanel>
<TextBlock Text="Input your name"/>
<TextBox Name="Name"/>
<Button Content="Close dialog"
Command="{Binding CloseDialogCommand}"
CommandParameter="{Binding Text, ElementName=Name}"/>
</StackPanel>
</UserControl>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- MaterialDesignColors (>= 1.1.3)
- MaterialDesignThemes (>= 2.4.1.1101)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Show, close material dialogs, dialog identifier.