using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Navigation;
using System.Windows.Shapes;
using BankTVUpdater.Helpers.Config.Local;

namespace BankTVUpdater.Controls
{
    /// <summary>
    /// Interaction logic for InputBox.xaml
    /// </summary>
    public partial class InputBox : UserControl
    {
        public InputBox()
        {
            InitializeComponent();
        }

        private void NoButton_Click(object sender, RoutedEventArgs e)
        {
            InputBoxGrid.Visibility = Visibility.Collapsed;            
            InputTextBox.Text = String.Empty;
        }

        private void YesButton_Click(object sender, RoutedEventArgs e)
        {            
            string city = InputTextBox.Text;
            if (String.IsNullOrWhiteSpace(city))
            {
                MessageBox.Show("Proszę wpisać nazwę miasta.");
                return;
            }   //if
            XmlLocalConfigHelper.SetLocalConfigObject(city);
            InputTextBox.Text = String.Empty;
            InputBoxGrid.Visibility = Visibility.Collapsed;
        }


    }
}
