Exemplo n.º 1
0
        public void SavePage(IMarkpadDocument documentViewModel)
        {
            if (documentViewModel == null)
            {
                return;
            }

            var dialogService = new DialogService();
            var fileName      = dialogService.GetFileSavePath(SAVE_TITLE, SAVE_DEFAULT_EXT, SAVE_FILTER);

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            var markdown = documentViewModel.MarkdownContent;
            var html     = _documentParser.ParseClean(markdown);

            File.WriteAllText(fileName, html);
        }