private void AddInstrumentManuallyBtn_ItemClick(object sender, RoutedEventArgs routedEventArgs) { var window = new AddInstrumentManuallyWindow(); window.ShowDialog(); if (window.InstrumentAdded) { Instruments.Add(window.TheInstrument); } window.Close(); }
//show a window to modify the selected instrument private void TableView_RowDoubleClick(object sender, MouseButtonEventArgs mouseButtonEventArgs) { var inst = (Instrument)InstrumentsGrid.SelectedItem; var window = new AddInstrumentManuallyWindow(inst, false); window.ShowDialog(); CollectionViewSource.GetDefaultView(InstrumentsGrid.ItemsSource).Refresh(); window.Close(); }
//show the window to add a new custom futures contract private void BtnAddCustomFutures_ItemClick(object sender, RoutedEventArgs routedEventArgs) { var window = new AddInstrumentManuallyWindow(addingContFut: true); window.ShowDialog(); if (window.InstrumentAdded) { Instruments.Add(window.TheInstrument); } window.Close(); }
//show the window to add a new custom futures contract private void BtnAddCustomFutures_ItemClick(object sender, RoutedEventArgs routedEventArgs) { var window = new AddInstrumentManuallyWindow(_client, addingContFut: true); window.ShowDialog(); if (window.ViewModel.AddedInstrument != null) { ViewModel.Instruments.Add(window.ViewModel.AddedInstrument); } window.Close(); }
//clone an instrument private void InstrumentContextCloneBtn_ItemClick(object sender, RoutedEventArgs routedEventArgs) { var inst = (Instrument)InstrumentsGrid.SelectedItem; var window = new AddInstrumentManuallyWindow(inst); window.ShowDialog(); if (window.InstrumentAdded) { Instruments.Add(window.TheInstrument); } window.Close(); }