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;
            }
        }
Exemplo n.º 2
0
 void OnCopy()
 {
     RichEditorService.Copy();
 }
Exemplo n.º 3
0
 void OnPaste()
 {
     RichEditorService.Paste();
 }
Exemplo n.º 4
0
 void OnCut()
 {
     RichEditorService.Cut();
 }
Exemplo n.º 5
0
 void OnUndo()
 {
     RichEditorService.Undo();
     (RedoCommand as DelegateCommand <object>).Do(x => x.RaiseCanExecuteChanged());
     (UndoCommand as DelegateCommand <object>).Do(x => x.RaiseCanExecuteChanged());
 }
Exemplo n.º 6
0
 bool CanUndo()
 {
     return((RichEditorService != null) ? RichEditorService.CanUndo() : false);
 }
 public void CreateNewFile(string content)
 {
     RichEditorService.SetRawContent(content);
     RichEditorService.FileName = "New Document";
     RibbonService.CloseBackstage();
 }