using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ReAct_PME
{
    /// <summary>
    /// Logique d'interaction pour InputBox.xaml
    /// </summary>
    public partial class InputBox : Window
    {
        public string Response { get; private set; } = "";

        public InputBox(string message, string title = "Saisie", string defaultValue = "")
        {
            InitializeComponent();
            this.Title = title;
            txtMessage.Text = message;
            txtInput.Text = defaultValue;
            txtInput.Focus();
            txtInput.SelectAll();
        }

        private void Ok_Click(object sender, RoutedEventArgs e)
        {
            Response = txtInput.Text;
            this.DialogResult = true; // ferme la fenêtre et renvoie OK
        }
    }
}

