diff --git a/Exmaple2.0/Views/MainWindow.axaml b/Exmaple2.0/Views/MainWindow.axaml
index 2f1a228..d1bf0e1 100644
--- a/Exmaple2.0/Views/MainWindow.axaml
+++ b/Exmaple2.0/Views/MainWindow.axaml
@@ -28,6 +28,8 @@
+
+
diff --git a/Exmaple2.0/Views/MainWindow.axaml.cs b/Exmaple2.0/Views/MainWindow.axaml.cs
index d15a6be..9e1dedb 100644
--- a/Exmaple2.0/Views/MainWindow.axaml.cs
+++ b/Exmaple2.0/Views/MainWindow.axaml.cs
@@ -199,4 +199,49 @@ await MessageBoxManager.GetMessageBoxCustom(
CloseOnClickAway = true
}).ShowAsPopupAsync(this);
}
+
+ private async void StandardInput_PopUp_OnClick(object? sender, RoutedEventArgs e)
+ {
+ var msBox = MessageBoxManager.GetMessageBoxStandard(
+ new MessageBoxStandardParams
+ {
+ ContentTitle = "Input",
+ Icon = MsBox.Avalonia.Enums.Icon.Question,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ CanResize = false,
+ MaxWidth = 500,
+ MaxHeight = 800,
+ SizeToContent = SizeToContent.WidthAndHeight,
+ ShowInCenter = true,
+ Topmost = false,
+ CloseOnClickAway = true,
+ InputParams = new InputParams { Label = "Your Name" }
+ });
+ await msBox.ShowAsPopupAsync(this);
+
+ Console.WriteLine("Your name is: " + msBox.InputValue);
+ }
+
+ private async void StandardInputPassword_PopUp_OnClick(object? sender, RoutedEventArgs e)
+ {
+ var msBox = MessageBoxManager.GetMessageBoxStandard(
+ new MessageBoxStandardParams
+ {
+ ContentTitle = "Password Input",
+ Icon = MsBox.Avalonia.Enums.Icon.Question,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ CanResize = false,
+ MaxWidth = 500,
+ MaxHeight = 800,
+ SizeToContent = SizeToContent.WidthAndHeight,
+ ShowInCenter = true,
+ Topmost = false,
+ CloseOnClickAway = true,
+ InputParams = new InputParams { Label = "Your Password", IsPassword = true, }
+ });
+
+ await msBox.ShowAsPopupAsync(this);
+
+ Console.WriteLine("Your password is: " + msBox.InputValue);
+ }
}
\ No newline at end of file
diff --git a/MsBox.Avalonia/Controls/MsBoxCustomView.axaml b/MsBox.Avalonia/Controls/MsBoxCustomView.axaml
index ed7152b..5ef3ec0 100644
--- a/MsBox.Avalonia/Controls/MsBoxCustomView.axaml
+++ b/MsBox.Avalonia/Controls/MsBoxCustomView.axaml
@@ -109,8 +109,11 @@
-
+
-
+
public bool Multiline { get; set; }
+ ///
+ /// Input is password
+ ///
+ public bool IsPassword { get; set; }
}
\ No newline at end of file
diff --git a/MsBox.Avalonia/ViewModels/AbstractMsBoxViewModel.cs b/MsBox.Avalonia/ViewModels/AbstractMsBoxViewModel.cs
index 88a4f50..3437a44 100644
--- a/MsBox.Avalonia/ViewModels/AbstractMsBoxViewModel.cs
+++ b/MsBox.Avalonia/ViewModels/AbstractMsBoxViewModel.cs
@@ -65,6 +65,7 @@ protected AbstractMsBoxViewModel(AbstractMessageBoxParams @params, Icon icon = I
InputLabel = @params.InputParams.Label;
InputValue = @params.InputParams.DefaultValue;
IsInputMultiline = @params.InputParams.Multiline;
+ InputPasswordChar = @params.InputParams.IsPassword ? '*' : '\0';
IsInputVisible = true;
}
}
@@ -110,6 +111,7 @@ protected AbstractMsBoxViewModel(AbstractMessageBoxParams @params, Icon icon = I
public abstract string InputLabel { get; internal set; }
public abstract string InputValue { get; set; }
public abstract bool IsInputMultiline { get; internal set; }
+ public abstract char InputPasswordChar { get; internal set; }
public abstract bool IsInputVisible { get; internal set; }
#endregion
diff --git a/MsBox.Avalonia/ViewModels/MsBoxCustomViewModel.cs b/MsBox.Avalonia/ViewModels/MsBoxCustomViewModel.cs
index 658e96d..5e518f5 100644
--- a/MsBox.Avalonia/ViewModels/MsBoxCustomViewModel.cs
+++ b/MsBox.Avalonia/ViewModels/MsBoxCustomViewModel.cs
@@ -33,6 +33,7 @@ public void SetFullApi(IFullApi fullApi)
public override string InputLabel { get; internal set; }
public override string InputValue { get; set; }
public override bool IsInputMultiline { get; internal set; }
+ public override char InputPasswordChar { get; internal set; }
public override bool IsInputVisible { get; internal set; }
#endregion
diff --git a/MsBox.Avalonia/ViewModels/MsBoxStandardViewModel.cs b/MsBox.Avalonia/ViewModels/MsBoxStandardViewModel.cs
index 71580e1..7fd1202 100644
--- a/MsBox.Avalonia/ViewModels/MsBoxStandardViewModel.cs
+++ b/MsBox.Avalonia/ViewModels/MsBoxStandardViewModel.cs
@@ -47,6 +47,7 @@ public void SetFullApi(IFullApi fullApi)
public override string InputLabel { get; internal set; }
public override string InputValue { get; set; }
public override bool IsInputMultiline { get; internal set; }
+ public override char InputPasswordChar { get; internal set; }
public override bool IsInputVisible { get; internal set; }
#endregion