using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace SilverlightApplication39
{
public partial class MainPage : UserControl
{
private Button TestButton = null;
private DispatcherTimer timer = null;
public MainPage()
{
InitializeComponent();
TestButton = new Button();
TestButton.Width = 200;
TestButton.Height = 24;
TestButton.Content = "Test";
TestButton.Click += new RoutedEventHandler(TestButton_Click);
LayoutRoot.Children.Add(TestButton);
timer = new DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 2);
timer.Tick += new EventHandler(timer_Tick);
}
void timer_Tick(object sender, EventArgs e)
{
TestButton.IsEnabled = true;
}
void TestButton_Click(object sender, RoutedEventArgs e)
{
TestButton.IsEnabled = false;
timer.Start();
}
}
}