/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase); ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent(Properties.Settings.Default.DefaultAccent), ThemeManager.DetectAppStyle(Application.Current).Item1); CurrentMarkdownTypeText = Properties.Settings.Default.MarkdownProcessor; sourceCode.TextChanged += new EventHandler((object obj, EventArgs e) => UpdatePreview()); sourceCode.TextChanged += new EventHandler((object obj, EventArgs e) => IsModified = CanUndo); var line = SourceCode.GetLineByOffset(CaretOffset); CurrentCaretStatisticsInfo = $"{Properties.Resources.Ln}: {line.LineNumber} {Properties.Resources.Col}: {CaretOffset - line.Offset}"; }