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 SalvestavSilverlight.ServiceReference1; using System.Windows.Threading; namespace SalvestavSilverlight { public partial class MainPage : UserControl { SalvestusteenusSoapClient klient = new SalvestusteenusSoapClient(); DispatcherTimer kell = new DispatcherTimer(); public MainPage() { InitializeComponent(); kell.Interval = new TimeSpan(0, 0, 5); kell.Tick += new EventHandler(kell_Tick); klient.KysiTekstCompleted += new EventHandler( klient_KysiTekstCompleted); kell.Start(); } void klient_KysiTekstCompleted(object sender, KysiTekstCompletedEventArgs e) { textBlock1.Text = e.Result.ToString(); } void kell_Tick(object sender, EventArgs e) { klient.KysiTekstAsync(); } private void button1_Click(object sender, RoutedEventArgs e) { klient.LisaTekstAsync(textBox1.Text); textBox1.Text = ""; } } }