Completed
Last Updated: 10 Nov 2021 15:01 by ADMIN
Release R3 2021 SP
n/a
Created on: 27 Oct 2021 08:48
Category: RichTextEditor
Type: Bug Report
0
RichTextEditor: Change the RichTextPasteType access modifier to public

there is a mistake with the accessibility modifier for `Telerik.XamarinForms.RichTextEditor.RichTextPasteType`. When it is Internal it's not possible to use the PasteCommand since it requires that type as input. 

 

Solution:

use reflection to get the enum

var assembly = typeof(RadRichTextEditor).Assembly;
var type = assembly.GetType("Telerik.XamarinForms.RichTextEditor.RichTextPasteType");
var obj = Enum.ToObject(type, 1);
await Clipboard.SetTextAsync("A pasted text");
var canExecute = richTextEditor.PasteCommand.CanExecute(obj);
richTextEditor.PasteCommand.Execute(obj);

0 comments