async void OnOpenFile() { FileOpenPicker open = new FileOpenPicker(); open.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; open.FileTypeFilter.Add(".rtf"); StorageFile file = await open.PickSingleFileAsync(); if (file != null) { IRandomAccessStream randAccStream = await file.OpenAsync(FileAccessMode.Read); RichEditorService.Do(x => x.OpenFileFromStream(randAccStream)); RibbonService.CloseBackstage(); RichEditorService.FileName = file.DisplayName; RichEditorService.FilePath = file.Path; } }
void OnCopy() { RichEditorService.Copy(); }
void OnPaste() { RichEditorService.Paste(); }
void OnCut() { RichEditorService.Cut(); }
void OnUndo() { RichEditorService.Undo(); (RedoCommand as DelegateCommand <object>).Do(x => x.RaiseCanExecuteChanged()); (UndoCommand as DelegateCommand <object>).Do(x => x.RaiseCanExecuteChanged()); }
bool CanUndo() { return((RichEditorService != null) ? RichEditorService.CanUndo() : false); }
public void CreateNewFile(string content) { RichEditorService.SetRawContent(content); RichEditorService.FileName = "New Document"; RibbonService.CloseBackstage(); }