-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRichEdit.razor
36 lines (33 loc) · 1.24 KB
/
RichEdit.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@page "/"
@using DevExpress.AIIntegration.Blazor.RichEdit
@using DevExpress.AI.Samples.Blazor.Editors.Components.AdditionalItems
@using DevExpress.Blazor.RichEdit
@using System.Reflection
<DxRichEdit DocumentContent="DocumentContent" CssClass="my-editor">
<AdditionalItems>
<ShakespeareAIContextMenuItem />
<SummarizeAIContextMenuItem />
<ExplainAIContextMenuItem />
<ProofreadAIContextMenuItem />
<ExpandAIContextMenuItem />
<ShortenAIContextMenuItem />
<AskAssistantAIContextMenuItem />
<ChangeStyleAIContextMenuItem />
<ChangeToneAIContextMenuItem />
<TranslateAIContextMenuItem Languages="@("German, French, Chinese")" />
</AdditionalItems>
</DxRichEdit>
@code {
const string DocumentResourceName = "DevExpress.AI.Samples.Blazor.Editors.Docs.Example.docx";
byte[] DocumentContent { get; set; }
protected override void OnInitialized()
{
using (var ms = new MemoryStream())
{
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(DocumentResourceName);
stream?.CopyTo(ms);
DocumentContent = ms.ToArray();
}
base.OnInitialized();
}
}