private void OnFillSvgInputChecked(object sender, RoutedEventArgs e) { if (_svgPage == null) { return; } try { this.Cursor = Cursors.Wait; this.ForceCursor = true; if (File.Exists(_svgFilePath) && (fillSvgInput.IsChecked != null && fillSvgInput.IsChecked.Value)) { _svgPage.LoadDocument(_svgFilePath); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Wpf-Svg Test Sample", MessageBoxButton.OK, MessageBoxImage.Error); } finally { this.Cursor = Cursors.Arrow; this.ForceCursor = false; } }
private void OnFillSvgInputChecked() { if (_svgPage == null) { tabSvgInput.Visibility = _optionSettings.ShowInputFile ? Visibility.Visible : Visibility.Collapsed; return; } Cursor saveCursor = this.Cursor; try { if (_optionSettings.ShowInputFile) { this.Cursor = Cursors.Wait; this.ForceCursor = true; if (File.Exists(_svgFilePath)) { _svgPage.LoadDocument(_svgFilePath); } else { _svgPage.UnloadDocument(); } } else { _svgPage.UnloadDocument(); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), AppErrorTitle, MessageBoxButton.OK, MessageBoxImage.Error); } finally { this.Cursor = saveCursor; this.ForceCursor = false; tabSvgInput.Visibility = _optionSettings.ShowInputFile ? Visibility.Visible : Visibility.Collapsed; } }