private void OnConvertClick(object sender, RoutedEventArgs e) { Debug.Assert(_parentFrame != null); if (_parentFrame == null) { return; } _isConverting = true; _isConversionError = false; btnConvert.IsEnabled = false; if (_converterOutput == null) { _converterOutput = new FileConverterOutput(); } _converterOutput.Options = _options; _converterOutput.Subscribe(this); _converterOutput.SourceFile = txtSourceFile.Text; _converterOutput.OutputDir = txtOutputDir.Text; _parentFrame.Content = _converterOutput; //_converterOutput.Convert(); this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new ConvertHandler(_converterOutput.Convert)); }