WPF C# Tutorial

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Eight Ball Answer" Height="328" Width="412" >
  
    
      
      
      
    

    
      
        
          
          
          
        

      

    

                 TextWrapping="Wrap" FontFamily="Verdana" FontSize="24"
             Grid.Row="0" >
      [Place question here.]
    
                Click="cmdAnswer_Click" 
            Grid.Row="1">      
      Ask the Eight Ball
      
                 TextWrapping="Wrap" IsReadOnly="True" FontFamily="Verdana" FontSize="24" Foreground="Green"
             Grid.Row="2">
      [Answer will appear here.]
        
  


//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Input;
namespace EightBall
{
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }
        private void cmdAnswer_Click(object sender, RoutedEventArgs e)
        {           
            this.Cursor = Cursors.Wait;
            System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
            txtAnswer.Text = "asdf";
            this.Cursor = null;
        }
    }
}