Browse Source

Добавлена блокировка главного окна при открытии других окон

master
Никита 6 years ago
parent
commit
6ef4e1ee8a
  1. 13
      Signal Generator/MainWindow.xaml.cs

13
Signal Generator/MainWindow.xaml.cs

@ -35,12 +35,19 @@ namespace Signal_Generator
private void addSignal_Button_Click(object sender, RoutedEventArgs e) private void addSignal_Button_Click(object sender, RoutedEventArgs e)
{ {
IsEnabled = false;
addSignalWindow_Instance = new AddSignalWindow(); addSignalWindow_Instance = new AddSignalWindow();
addSignalWindow_Instance.createItem_Button.Click += addSignalWindow_Instance_Closing; addSignalWindow_Instance.createItem_Button.Click += addSignalWindow_createItem_Button_Click;
addSignalWindow_Instance.Closed += enableMainWindow;
addSignalWindow_Instance.Show(); addSignalWindow_Instance.Show();
} }
private void addSignalWindow_Instance_Closing(object sender, EventArgs e) private void enableMainWindow(object sender, EventArgs e)
{
IsEnabled = true;
}
private void addSignalWindow_createItem_Button_Click(object sender, EventArgs e)
{ {
var signal = null as IAnalogSignal; var signal = null as IAnalogSignal;
signal = (IAnalogSignal) addSignalWindow_Instance.signalType_ComboBox.SelectedItem; signal = (IAnalogSignal) addSignalWindow_Instance.signalType_ComboBox.SelectedItem;
@ -52,6 +59,7 @@ namespace Signal_Generator
private void startProcedure_Button_Click(object sender, RoutedEventArgs e) private void startProcedure_Button_Click(object sender, RoutedEventArgs e)
{ {
IsEnabled = false;
MultiSignal ms = new MultiSignal(); MultiSignal ms = new MultiSignal();
foreach (IAnalogSignal item in signalCollection) foreach (IAnalogSignal item in signalCollection)
{ {
@ -59,6 +67,7 @@ namespace Signal_Generator
} }
taskWindow_Instance = new TaskWindow(ms); taskWindow_Instance = new TaskWindow(ms);
taskWindow_Instance.Show(); taskWindow_Instance.Show();
taskWindow_Instance.Closed += enableMainWindow;
} }
private void removeSignal_Button_Click(object sender, RoutedEventArgs e) private void removeSignal_Button_Click(object sender, RoutedEventArgs e)

Loading…
Cancel
Save