private void MainWindowViewModel_OnAccountStatusEventReceived(object sender, SharedData.events.GenericResponseEventArgs e) { App.Current.Dispatcher.Invoke((Action) delegate { AvailableCash = decimal.Parse(e.GenericResponse["availableCash"]); FloatingPL = decimal.Parse(e.GenericResponse["floating"]); UsedMargin = decimal.Parse(e.GenericResponse["usedMargin"]); UsableMargin = decimal.Parse(e.GenericResponse["usableMargin"]); Equity = decimal.Parse(e.GenericResponse["equity"]); }); }
private void MainWindow_OnGenericResponseReceived(object sender, SharedData.events.GenericResponseEventArgs e) { clientExchangeName = e.GenericResponse["clientExchangeName"]; responseQueueName = e.GenericResponse["responseQueueName"]; ClientService.GetInstance().init(username, password, clientExchangeName, responseQueueName); System.Windows.Threading. Dispatcher.CurrentDispatcher.Invoke(async() => { await progressController.CloseAsync(); MetroDialogSettings set = new MetroDialogSettings(); await _dialogCoord.ShowMessageAsync(this, "Authentication", "Login successful."); //we are done here AuthService.Cleanup(); }); }