Esempio n. 1
0
 private void TradeWindow_Closed(object sender, EventArgs e)
 {
     this.Dispatcher.Invoke(DispatcherPriority.Background, (ThreadStart) delegate
     {
         tradeWindow = null;
     });
 }
Esempio n. 2
0
        private async Task OpenTradeWindow()
        {
            await Task.Run(() =>
            {
                this.Dispatcher.Invoke(DispatcherPriority.Background, (ThreadStart) delegate
                {
                    if (tradeWindow == null)
                    {
                        tradeWindow       = new TradeWindow(CurrencyPair.Parse(selectedCurrency));
                        tradeWindow.Owner = MainWindow;

                        tradeWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;

                        tradeWindow.Show();
                        tradeWindow.Closed += TradeWindow_Closed;
                    }
                });
            });
        }