private Object WrapperModule(object module, string dutyCode = null) { Microsoft.Windows.Controls.BusyIndicator busyIndicator = new Microsoft.Windows.Controls.BusyIndicator(); busyIndicator.Content = module; if (!Utility.HasDuty(dutyCode)) { if (module is AT_BC.Client.Extensions.EditableUserControl) { (module as AT_BC.Client.Extensions.EditableUserControl).IsReadOnly = true; } } return(busyIndicator); }
/// <summary> /// Window Loaded event: Set up timer, set controls disabled on startup /// and prepare eye tracking point. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Loaded(object sender, RoutedEventArgs e) { timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(50); timer.Tick += timer_Tick; CsvFilePathTextBox.IsEnabled = false; MediaFilePathTextBox.IsEnabled = false; SetControlButtonsEnabled(false); ResetButton.IsEnabled = false; EyePointInit(); waveformColors = new List<System.Drawing.Color>(); activityWaveformColors = new List<System.Drawing.Color>(); EEGGraphInit(); EmotionGraphInit(); SpectrumGraphInit(); ActivityGraphInit(); // Add electrodes to combo box (EEG and spectrum) foreach (var item in Enum.GetValues(typeof(Electrode))) { CurrentWaveComboBox.Items.Add(item); CurrentSpectrumComboBox.Items.Add(item); } // Add spectrum sizes to combobox foreach (var value in spectrumSizes) { CurrentSpectrumSizeComboBox.Items.Add(value); } worker.DoWork += worker_DoWork; worker.RunWorkerCompleted += worker_RunWorkerCompleted; BusyBar = new Microsoft.Windows.Controls.BusyIndicator(); BusyBar.BusyContent = "Loading CSV data..."; BusyBar.Margin = new Thickness((MediaCanvas.ActualWidth / 2) - 75, MediaCanvas.ActualHeight / 2, 0, 0); MediaCanvas.Children.Add(BusyBar); }