Ticket T1256162
Visible to All Users

AI Blazor RichEdit Integration in v24.2EAP

created 6 months ago

Hi,

Is it possible to get the AI Extensions for Blazor RichEdit control working in an XAF Blazor application ?

I cannot find any XAF examples or documentation for the new AI integration… are there plans to add these?

I looked at the Blazor example project to see how to add the new AI options,
but in the sample project this is done by adding Additional Settings in the .razor file

<DxRichEdit DocumentContent="DocumentContent" CssClass="my-editor">
<AdditionalSettings>
<SummaryAISettings />
<ExplainAISettings />
<ProofreadAISettings />
<ExpandAISettings />
<ShortenAISettings />
<CustomAISettings />
<RewriteAISettings />
<ToneAISettings />
<TranslateAISettings Languages="@("German, French, Chinese")" />
</AdditionalSettings>
</DxRichEdit>

How do I add these "AdditionalSettings" programatically from my XAF blazor app ? or is this even possible ?

many thanks in advance

Answers approved by DevExpress Support

created 6 months ago

Hello, Peter.

You can take How to: Access and Customize Rich Text Editor Controls as a base, and add the following files in your SolutionName.Blazor project (reference the DevExpress.AIIntegration.Blazor.RichEdit NuGet package to the project to compile this code).

TestContoller.cs:

C#
using DevExpress.ExpressApp; using DevExpress.ExpressApp.Office.Blazor.Editors; namespace MainDemo.Blazor.Server.Controllers; public class TestContoller : ViewController<DetailView> {     protected override void OnActivated()     {         base.OnActivated();         View.CustomizeViewItemControl<RichTextPropertyEditor>(this, (p) => {             p.ComponentModel.AdditionalSettings = AdditionalSettings.Create();         });     } }

AdditionalSettings.razor:

Razor
@using DevExpress.AIIntegration.Blazor.RichEdit @using DevExpress.Blazor.RichEdit <SummaryAISettings /> <ExplainAISettings /> <ProofreadAISettings /> <ExpandAISettings /> <ShortenAISettings /> <CustomAISettings /> <RewriteAISettings /> <ToneAISettings /> <TranslateAISettings Languages="@("German, French, Chinese")" /> @code {     public static RenderFragment Create() => @<AdditionalSettings />; }

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.