void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.thisWindow = ((AvalancheDemo.DisplayResult)(target)); return; case 2: this.label = ((System.Windows.Controls.Label)(target)); return; case 3: this.richTextBox = ((System.Windows.Controls.RichTextBox)(target)); return; } this._contentLoaded = true; }
private async void readHttp() { string response = await TS; textBox.Text = "Text Recognizing on Cloud ..."; Timer t = new Timer(5000) { Enabled = true }; t.Elapsed += (object sender, ElapsedEventArgs e) => { this.Dispatcher.Invoke(() => { IRestResponse fetch = fetchResult(); if (fetch.StatusCode == System.Net.HttpStatusCode.OK) { DisplayResult displaywindow = new DisplayResult(fetch.Content); displaywindow.Show(); this.Close(); t.Enabled = false; } }); }; }