MaterialDesignXaml.DialogsHelper 1.0.0

There is a newer version of this package available.
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
#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

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 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.

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
1.0.4 957 11/1/2022
1.0.3 2,772 12/9/2019
1.0.2 1,689 5/12/2019
1.0.1 724 5/6/2019
1.0.0 1,968 9/10/2018

Show, close material dialogs, dialog identifier.