public MainWindow(IMarkdownConverter markdownConverter, ISpellCheckProvider spellCheckProvider, FindReplaceDialog findReplaceDialog) { InitializeComponent(); MarkdownConverter = markdownConverter; SpellCheckProvider = spellCheckProvider; FindReplaceDialog = findReplaceDialog; Loaded += OnLoaded; Closing += OnClosing; SizeChanged += (s, e) => CalculateEditorMargins(); Editor.PropertyChanged += EditorOnPropertyChanged; Editor.TextChanged += (s, e) => Preview.UpdatePreview(Editor.Text); Editor.ScrollChanged += (s, e) => Preview.SetScrollOffset(e); }
private void ExecuteUpdatePreview(object sender, ExecutedRoutedEventArgs e) => Preview.UpdatePreview(Editor.Text);