public void ShowSendDialog(string link, Action closed) { if (_dxSwapChainPanel == null) { throw new InvalidOperationException("WSANativeFacebook.ConfigureDialogs must first be called from MainPage.xaml.cs"); } Dictionary <string, string> parameters = new Dictionary <string, string>() { { "link", link } }; string sendBaseUri = string.Format("{0}?app_id={1}&display=popup&redirect_uri={2}", WSAFacebookConstants.SendDialogUri, _facebookAppId, WSAFacebookConstants.WebRedirectUri); SendDialog dialog = new SendDialog(Screen.width, Screen.height); dialog.Show(sendBaseUri, parameters, WSAFacebookConstants.SendDialogResponseUri, _dxSwapChainPanel, closed); }
private void btnSend_Click(object sender, EventArgs e) { using (SendDialog dialog = new SendDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { string fromAddress = dialog.GetFromAddress(); string toAddress = dialog.GetToAddress(); string strAmount = dialog.GetAmount(); object AssetID = dialog.GetAssetID(); SendCoinThread scthread = new SendCoinThread(); scthread.Amount = strAmount; scthread.FromAddr = fromAddress; scthread.ToAddr = toAddress; scthread.Asset = AssetID; ThreadStart starter = new ThreadStart(scthread.DoWork); starter += () => { // Do what you want in the callback Invoke(new Action(() => { lbl_status.Text = lbl_status.Text.Substring(0, lbl_status.Text.Length - 12); })); }; Invoke(new Action(() => { lbl_status.Text = lbl_status.Text + ";Sending Tx."; })); Thread thread = new Thread(starter) { IsBackground = true }; thread.Start(); return; } } }