private void UpdateNextButtonEnabled() { try { var isInstalled = _mediaFilters.IsLavFiltersInstalled(); BtnNext.IsEnabled = isInstalled; BtnInstall.Visibility = isInstalled ? Visibility.Collapsed : Visibility.Visible; PanelInstalled.Visibility = isInstalled ? Visibility.Visible : Visibility.Collapsed; } catch { BtnNext.IsEnabled = false; BtnInstall.Visibility = Visibility.Visible; PanelInstalled.Visibility = Visibility.Collapsed; } if (BtnInstall.Visibility == Visibility.Visible) { BtnInstall.Focus(); } else { BtnNext.Focus(); } }
public void EnableAsync(object sender, EventArgs e) { BtnNext.Enabled = true; BtnNext.Focus(); var rb = (RadioButton)sender; var tmp = rb.Name; _checkIndex = int.Parse(tmp.Substring(11)); }
private void UpdateNextButtonEnabled() { try { var isLavSplitterInstalled = _mediaFilters.IsLavSplitterInstalled(); var isLavAudioInstalled = _mediaFilters.IsLavAudioInstalled(); var isLavVideoInstalled = _mediaFilters.IsLavVideoInstalled(); BtnNext.IsEnabled = isLavSplitterInstalled && isLavAudioInstalled && isLavVideoInstalled; BtnInstall.Visibility = BtnNext.IsEnabled ? Visibility.Collapsed : Visibility.Visible; PanelSplitterInstalled.Visibility = isLavSplitterInstalled ? Visibility.Visible : Visibility.Collapsed; PanelAudioInstalled.Visibility = isLavAudioInstalled ? Visibility.Visible : Visibility.Collapsed; PanelVideoInstalled.Visibility = isLavVideoInstalled ? Visibility.Visible : Visibility.Collapsed; PanelSplitterNotInstalled.Visibility = isLavSplitterInstalled ? Visibility.Collapsed : Visibility.Visible; PanelAudioNotInstalled.Visibility = isLavAudioInstalled ? Visibility.Collapsed : Visibility.Visible; PanelVideoNotInstalled.Visibility = isLavVideoInstalled ? Visibility.Collapsed : Visibility.Visible; } catch { BtnNext.IsEnabled = false; BtnInstall.Visibility = Visibility.Visible; PanelSplitterInstalled.Visibility = Visibility.Collapsed; PanelAudioInstalled.Visibility = Visibility.Collapsed; PanelVideoInstalled.Visibility = Visibility.Collapsed; PanelSplitterNotInstalled.Visibility = Visibility.Visible; PanelAudioNotInstalled.Visibility = Visibility.Visible; PanelVideoNotInstalled.Visibility = Visibility.Visible; } if (BtnInstall.Visibility == Visibility.Visible) { BtnInstall.Focus(); } else { BtnNext.Focus(); } }