public void UpdateControls() { AddButton.IsEnabled = false; RemoveButton.IsEnabled = false; MakeManagerButton.IsEnabled = false; if (ManagerstationGrid.SelectedItem != null) { StationStatus ss = (StationStatus)ManagerstationGrid.SelectedItem; if (ss.Connected()) { AddButton.IsEnabled = false; RemoveButton.IsEnabled = true; MakeManagerButton.IsEnabled = true; } else if (ss.Synchronizing()) { AddButton.IsEnabled = false; RemoveButton.IsEnabled = false; MakeManagerButton.IsEnabled = false; } else { AddButton.IsEnabled = true; RemoveButton.IsEnabled = false; MakeManagerButton.IsEnabled = false; } } }
public void UpdateControls() { AddButton.IsEnabled = false; RemoveButton.IsEnabled = false; if (stationGrid.SelectedItem != null) { StationStatus ss = (StationStatus)stationGrid.SelectedItem; if (ss.Connected()) { AddButton.IsEnabled = false; RemoveButton.IsEnabled = true; } else if (ss.Synchronizing()) { AddButton.IsEnabled = false; RemoveButton.IsEnabled = false; } else { AddButton.IsEnabled = true; RemoveButton.IsEnabled = false; } } StartEndElectionButton.IsEnabled = false; foreach (StationStatus s in stationGrid.ItemsSource) { if (s.Connected()) { StartEndElectionButton.IsEnabled = true; } } }