How to use copy command and and copy the response has context menu ~ Split from 169284

Hi 


I am using AIAssistView and I want to access the copy button under each response to know which one I am tapping on I know I have to use the copycommand but the example doesn't show how to copy the current response and there is no way of accessing the button to know which one I am clicking on or tapping any ideas how to achieve this thanks 


another issue is that Screenshot 2024-11-14 061332.png the text input is wrapping the text 


4 Replies

AF Anees Fathima Shajahan Syncfusion Team November 14, 2024 12:45 PM UTC

Hi Customer,


1.The ItemCopyCommand is triggered when the user clicks on the copy action icon in a response item. To copy the current response, the ItemCopyCommand receives the command parameter as an AssistItem, from which we can extract the text of the current item. Please refer to the code snippet below.


ItemCopyCommand UG Link: https://help.syncfusion.com/maui/aiassistview/events?cs-save-lang=1&cs-lang=csharp#itemcopy-command


 public ICommand CopyCommand { get; set; }

 

 public GettingStartedViewModel()

 {

     this.CopyCommand = new Command<object>(ExecuteCopyCommand);

 }

 

 private void ExecuteCopyCommand(object obj)

 {

     string text = (obj as AssistItem).Text;

 

     // To remove unwanted HTML tags and the &nbsp; (non-breaking space) entity from the text.

     text = Regex.Replace(text, "<.*?>|&nbsp;", string.Empty);

 

     // Copy the text to the clipboard

     Clipboard.SetTextAsync(text);

 }



2. The text wrapping issue inside the editor is related to the framework editor used in our control in .NET MAUI version 8.0.90. This issue has been resolved in the latest release, version 8.0.92 and above. We recommend upgrading the .NET MAUI package to version 8.0.92 or higher to resolve the issue. If you continue to experience any problems or have further questions, please don't hesitate to reach out.


Regards,

Anees Fathima.



RA Ramez Abiad replied to Anees Fathima Shajahan November 15, 2024 10:00 PM UTC

Thanks,


Ramez Abiad



RA Ramez Abiad replied to Ramez Abiad November 17, 2024 07:32 PM UTC

Hi

How do I select part of the text like the one below thanks : 

 Assist.png



AF Anees Fathima Shajahan Syncfusion Team November 18, 2024 01:48 PM UTC

Hi Ramez Abiad ,


We have provided an answer to your query in the following forum ticket: Customizing Syncfusion’s .NET MAUI AI AssistView for AI PC Interfaces | Syncfusion Forum Assist


Regards,
Anees Fathima.


Loader.
Up arrow icon