2024-04-18 01:44:37 +02:00
|
|
|
|
using Windows.UI.Xaml;
|
|
|
|
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
namespace Wino.Dialogs;
|
|
|
|
|
|
|
|
|
|
|
|
public sealed partial class TextInputDialog : ContentDialog
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
public bool? HasInput { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string CurrentInput
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (string)GetValue(CurrentInputProperty); }
|
|
|
|
|
|
set { SetValue(CurrentInputProperty, value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty CurrentInputProperty = DependencyProperty.Register(nameof(CurrentInput), typeof(string), typeof(TextInputDialog), new PropertyMetadata(string.Empty));
|
|
|
|
|
|
|
|
|
|
|
|
public TextInputDialog()
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetDescription(string description)
|
|
|
|
|
|
{
|
|
|
|
|
|
DialogDescription.Text = description;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetPrimaryButtonText(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
PrimaryButtonText = text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
|
|
|
|
|
{
|
|
|
|
|
|
Hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateOrCreateClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
|
|
|
|
|
{
|
|
|
|
|
|
HasInput = true;
|
|
|
|
|
|
|
|
|
|
|
|
Hide();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|