이유가 무엇이든, 아래 코드의 마지막 줄에는 2 개의 인수가 포함 된 InputDialog의 생성자를 찾지 못하는 것에 대한 불만이 있습니다. 명확하게 정의 된 것을 볼 수 있지만 내 프로젝트에서 생성자를 찾을 수 없습니까?
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
내가주는 InputDialog에 대한 코드를 확인하고이 발견
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();
}
은 분명히 클래스가 올바른 이름 및 2 인자와 올바른 유형의 올바른 생성자가 있습니다. 그러면 오류가 무엇입니까?
필자는 본질적으로 here 코드를 개조하여 비밀번호 상자가있는 4-6 자리 핀을 요청하는 인증 대화 상자를 갖기 위해 노력하고 있습니다. MaHapps Metro 코드를 변경해서는 안되기 때문에 필자는 필 요에 맞게 코드를 복사하고 수정하려고 시도했습니다.
내부 수정자를 볼 수 없었습니다. 그래서 나는 SOL! – ryseagain
그건 '내부'가 의미하는 것이 아닙니다. –
@Eric, 네, 맞아. 업데이트 된 답변. –