using System.Windows; namespace Explorer.App; public partial class PromptWindow : Window { public PromptWindow(string title, string message, string initial) { InitializeComponent(); Title = title; Message.Text = message; Input.Text = initial; Input.SelectAll(); Loaded += (_, _) => Input.Focus(); } public string Value => Input.Text; private void OnOk(object sender, RoutedEventArgs e) { DialogResult = true; Close(); } public static string? Ask(Window owner, string title, string message, string initial) { var dlg = new PromptWindow(title, message, initial) { Owner = owner }; return dlg.ShowDialog() == true ? dlg.Value : null; } }