private ITextBuffer SaveFile() { var document = EditorExtensions.FindInProjectedBuffers <MdEditorDocument>(TextView.TextBuffer, MdContentTypeDefinition.ContentType); var tb = document.TextBuffer; if (!tb.CanBeSavedInCurrentEncoding()) { if (MessageButtons.No == AppShell.ShowMessage(Resources.Warning_SaveInUtf8, MessageButtons.YesNo)) { return(null); } tb.Save(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); } else { tb.Save(); } return(tb); }