Skip to content

Commit 4e17fb0

Browse files
Removed unwanted codes
1 parent a295832 commit 4e17fb0

File tree

1 file changed

+23
-68
lines changed

1 file changed

+23
-68
lines changed

MAUI/AIAssistView/items.md

Lines changed: 23 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -432,85 +432,40 @@ The `SfAIAssistView` control includes a built-in event called [CardTapped](https
432432

433433
The `SfAIAssistView` allows to display error responses by setting the text to the `ErrorMessage`, ensuring clear notification when an error occurs during AI interactions.
434434

435-
{% tabs %}
436-
{% highlight xaml %}
437-
438-
<?xml version="1.0" encoding="utf-8" ?>
439-
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
440-
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
441-
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.AIAssistView;assembly=Syncfusion.Maui.AIAssistView"
442-
xmlns:local="clr-namespace:MauiAIAssistView"
443-
x:Class="MauiAIAssistView.MainPage">
444-
445-
<ContentPage.BindingContext>
446-
<local:ViewModel/>
447-
</ContentPage.BindingContext>
448-
449-
<ContentPage.Content>
450-
<syncfusion:SfAIAssistView x:Name="sfAIAssistView"
451-
AssistItems="{Binding AssistItems}"/>
452-
</ContentPage.Content>
453-
</ContentPage>
454-
455-
{% endhighlight %}
456-
{% highlight c# %}
457-
458-
using Syncfusion.Maui.AIAssistView;
459-
460-
namespace MauiAIAssistView
461-
{
462-
public partial class MainPage : ContentPage
463-
{
464-
SfAiAssistView sfAIAssistView;
465-
ViewModel viewModel;
466-
public MainPage()
467-
{
468-
InitializeComponent();
469-
this.sfAIAssistView = new SfAIAssistView();
470-
this.viewModel = new ViewModel();
471-
this.sfAIAssistView.AssistItems = viewModel.AssistItems;
472-
this.Content = sfAIAssistView;
473-
}
474-
}
475-
}
476-
{% endhighlight %}
477-
{% endtabs %}
478-
479435
{% tabs %}
480436
{% highlight c# tabtitle="ViewModel.cs" hl_lines="24" %}
481437

482-
public class ViewModel : INotifyPropertyChanged
483-
{
438+
public class ViewModel : INotifyPropertyChanged
439+
{
484440

485-
...
441+
...
486442

487-
private void GenerateAssistItems()
443+
private void GenerateAssistItems()
444+
{
445+
AssistItem requestItem = new AssistItem()
488446
{
489-
AssistItem requestItem = new AssistItem()
490-
{
491-
Text = "Types of listening",
492-
IsRequested = true
493-
};
447+
Text = "Types of listening",
448+
IsRequested = true
449+
};
494450

495-
this.AssistItems.Add(requestItem);
451+
this.AssistItems.Add(requestItem);
496452

497-
await GetResult(requestItem);
498-
}
499-
500-
private async Task GetResult(AssistItem requestItem)
501-
{
502-
await Task.Delay(1000).ConfigureAwait(true);
453+
await GetResult(requestItem);
454+
}
455+
456+
private async Task GetResult(AssistItem requestItem)
457+
{
458+
await Task.Delay(1000).ConfigureAwait(true);
503459

504-
AssistItem responseItem = new AssistItem()
505-
{
506-
ErrorMessage = "An error occured. Either the engine you requested does not exist or there was another issue processing your request.",
507-
IsRequested = false,
508-
};
460+
AssistItem responseItem = new AssistItem()
461+
{
462+
ErrorMessage = "An error occured. Either the engine you requested does not exist or there was another issue processing your request.",
463+
IsRequested = false,
464+
};
509465

510-
this.AssistItems.Add(responseItem);
511-
512-
}
466+
this.AssistItems.Add(responseItem);
513467
}
468+
}
514469

515470
{% endhighlight %}
516471
{% endtabs %}

0 commit comments

Comments
 (0)