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;

namespace WPFSOAPService
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void btnQuit_Click(object sender, RoutedEventArgs e)
        {
            // End the application.
            Close();
        }

        private void btnWeather_Click(object sender, RoutedEventArgs e)
        {
            // Create an instance of the Weather service.
            NationalWeather.WeatherSoapClient Client =
                new NationalWeather.WeatherSoapClient();

            // Make a query to the Weather service.
            var WeatherResults = from Forecast
                                 in Client.GetWeather(txtCity.Text)
                                 select Forecast;

            // Combine the individual characters of the forecast into
            // a single string.
            txtResults.Text = "";
            foreach (Char Letter in WeatherResults)
                txtResults.Text = txtResults.Text + Letter;
        }
    }
}
