For whatever reason, the last line in the code below complains about not finding a constructor for InputDialog that contains 2 arguments.
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
namespace order
{
public static class DialogManager
{
public static Task<string> ShowInputAsync(this MetroWindow window, string title, string message, MetroDialogSettings settings = null)
{
window.Dispatcher.VerifyAccess();
return HandleOverlayOnShow(settings, window).ContinueWith(z =>
{
return (Task<string>)window.Dispatcher.Invoke(new Func<Task<string>>(() =>
{
if (settings == null)
settings = window.MetroDialogOptions;
//create the dialog control
InputDialog dialog = new InputDialog(window, settings); // error: does not contain a constructor With 2 arguments
I checked the code for InputDialog and found this:
namespace MahApps.Metro.Controls.Dialogs
{
public partial class InputDialog : BaseMetroDialog
{
internal InputDialog(MetroWindow parentWindow)
: this(parentWindow, null)
{
}
internal InputDialog(MetroWindow parentWindow, MetroDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
}
Clearly the class has the right name, and the correct constructor with 2 arguments and the correct types. So what gives the error?
I essentially is trying to retrofit the code found here to have a authentication dialog that ask for a 4-6 digit pin With a password Box. Since I shouldn't change MaHapps Metro code, I copied and attempting to modify the code to fit my needs.