Skip to content

Commit 175193f

Browse files
Merge pull request #3884 from syncfusion-content/998547
998547: Prepare UG documentation for 2025 Volume 4 features - MAUI AssistView, TreeView
2 parents fc37cd5 + bdb143c commit 175193f

File tree

6 files changed

+114
-13
lines changed

6 files changed

+114
-13
lines changed
10 KB
Loading
-126 KB
Loading

MAUI/AIAssistView/items.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ The following views can be customized individually:
502502
- `CardButtonView` – Represents an action button inside a card item; exposes Title and Value bindable properties
503503

504504
{% tabs %}
505-
{% highlight xaml hl_lines="12 27" %}
505+
{% highlight xaml hl_lines="14 30" %}
506506

507507
<?xml version="1.0" encoding="utf-8"?>
508508
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
@@ -559,7 +559,7 @@ The following views can be customized individually:
559559
</ContentPage>
560560

561561
{% endhighlight %}
562-
{% highlight c# hl_lines="18 41" %}
562+
{% highlight c# hl_lines="23 47" %}
563563

564564
using Syncfusion.Maui.AIAssistView;
565565

MAUI/AIAssistView/styles.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,3 +1293,67 @@ public MainPage()
12931293

12941294
{% endhighlight %}
12951295
{% endtabs %}
1296+
1297+
## Response suggestion header text style
1298+
1299+
To style the response suggestion header text view based on its appearance, set values to the in-built keys in the resource dictionary.
1300+
1301+
<table>
1302+
<tr>
1303+
<th> Key </th>
1304+
<th> Description </th>
1305+
</tr>
1306+
<tr>
1307+
<td> SfAIAssistViewSuggestionHeaderTextColor </td>
1308+
<td> Text color of response suggestion header text. </td>
1309+
</tr>
1310+
<tr>
1311+
<td> SfAIAssistViewSuggestionHeaderFontSize </td>
1312+
<td> Font size of response suggestion header text. </td>
1313+
</tr>
1314+
<tr>
1315+
<td> SfAIAssistViewSuggestionHeaderFontFamily </td>
1316+
<td> Font family of response suggestion header text. </td>
1317+
</tr>
1318+
<tr>
1319+
<td> SfAIAssistViewSuggestionHeaderFontAttributes </td>
1320+
<td> Font attributes of response suggestion header text. </td>
1321+
</tr>
1322+
</table>
1323+
1324+
{% tabs %}
1325+
{% highlight xaml %}
1326+
1327+
<ContentPage.Resources>
1328+
<syncTheme:SyncfusionThemeDictionary>
1329+
<syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
1330+
<ResourceDictionary>
1331+
<x:String x:Key="SfAIAssistViewTheme">CustomTheme</x:String>
1332+
<Color x:Key="SfAIAssistViewSuggestionHeaderTextColor">DarkBlue</Color>
1333+
<x:Double x:Key="SfAIAssistViewSuggestionHeaderFontSize">14</x:Double>
1334+
<x:String x:Key="SfAIAssistViewSuggestionHeaderFontFamily">Roboto-Medium</x:String>
1335+
<FontAttributes x:Key="SfAIAssistViewSuggestionHeaderFontAttributes">Bold</FontAttributes>
1336+
</ResourceDictionary>
1337+
</syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
1338+
</syncTheme:SyncfusionThemeDictionary>
1339+
</ContentPage.Resources>
1340+
1341+
{% endhighlight %}
1342+
{% highlight c# %}
1343+
1344+
public MainPage()
1345+
{
1346+
....
1347+
InitializeComponent();
1348+
ResourceDictionary dictionary = new ResourceDictionary();
1349+
dictionary.Add("SfAIAssistViewTheme", "CustomTheme");
1350+
dictionary.Add("SfAIAssistViewSuggestionHeaderTextColor", Colors.DarkBlue);
1351+
dictionary.Add("SfAIAssistViewSuggestionHeaderFontSize", 14);
1352+
dictionary.Add("SfAIAssistViewSuggestionHeaderFontFamily", "Roboto-Medium");
1353+
dictionary.Add("SfAIAssistViewSuggestionHeaderFontAttributes", FontAttributes.Bold);
1354+
this.Resources.Add(dictionary);
1355+
....
1356+
}
1357+
1358+
{% endhighlight %}
1359+
{% endtabs %}

MAUI/AIAssistView/suggestions.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,44 @@ The [AssistItemSuggestion.ItemSpacing](https://help.syncfusion.com/cr/maui/Syncf
384384
{% endhighlight %}
385385
{% endtabs %}
386386

387+
### Response item suggestion header
388+
389+
The `SfAIAssistView` control allows you to define the header text for each response suggestion by setting a custom text to the `AssistItem.SuggestionHeaderText` property, ensuring clear identification and context for each suggestion group displayed to users.
390+
391+
{% tabs %}
392+
{% highlight c# tabtitle="ViewModel.cs" hl_lines="19" %}
393+
394+
...
395+
private async Task GetResult(AssistItem requestItem)
396+
{
397+
await Task.Delay(1000).ConfigureAwait(true);
398+
399+
AssistItem responseItem = new AssistItem()
400+
{
401+
Text = "MAUI stands for .NET Multi-platform App UI. It's a .NET framework for building cross-platform apps with a single C# codebase for iOS, Android, macOS, and Windows. Sure! Here's a link to learn more about .NET MAUI",
402+
};
403+
404+
var assistSuggestions = new AssistItemSuggestion();
405+
406+
suggestions = new ObservableCollection<ISuggestion>();
407+
suggestions.Add(new AssistSuggestion() { Text = "Get started with .NET MAUI" });
408+
suggestions.Add(new AssistSuggestion() { Text = "Build your first MAUI app" });
409+
410+
assistSuggestions.Items = suggestions;
411+
412+
assistSuggestions.SuggestionHeaderText = "Related Topics";
413+
414+
// Assign suggestions to response item.
415+
responseItem.Suggestion = assistSuggestions;
416+
this.AssistItems.Add(responseItem);
417+
}
418+
...
419+
420+
{% endhighlight %}
421+
{% endtabs %}
422+
423+
![Suggestion Header Text in .NET MAUI AI AssistView](Images/suggestions/maui-aiassistview-suggestion-headertext.png)
424+
387425
### Response item suggestion customization
388426
The `SfAIAssistView` control allows you to fully customize the appearance of the response suggestion items using the [ResponseSuggestionTemplate](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.AIAssistView.SfAIAssistView.html#Syncfusion_Maui_AIAssistView_SfAIAssistView_ResponseSuggestionTemplate) property. This property lets you define a custom layout and style for the suggestion item UI.
389427

@@ -435,7 +473,6 @@ public partial class MainPage : ContentPage
435473

436474
![Suggestion Template in .NET MAUI AI AssistView](Images/suggestions/maui-aiassistview-suggestiontemplate.png)
437475

438-
439476
## Event and Commands
440477

441478
When a user selects a suggestion, the [SuggestionItemSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.AIAssistView.SfAIAssistView.html#Syncfusion_Maui_AIAssistView_SfAIAssistView_SuggestionItemSelected) event and [SuggestionItemSelectedCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.AIAssistView.SfAIAssistView.html#Syncfusion_Maui_AIAssistView_SfAIAssistView_SuggestionItemSelectedCommand) are triggered, providing [SuggestionItemSelectedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.AIAssistView.SuggestionItemSelectedEventArgs.html) as arguments. This arguments contains the following details about the selected suggestion item.

MAUI/AIAssistView/working-with-aiassistview.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ N> [View sample in GitHub](https://github.com/SyncfusionExamples/custom-control-
267267

268268
The `SfAIAssistView` allows you to edit a previously sent request. This feature lets users review and refine the prompt and resubmit from the editor to get more accurate responses. Each request shows an Edit icon; when tapped, the request text is placed in the editor (InputView) to redefine.
269269

270-
N> Interaction: On desktop (Windows, macOS), hover over a request to reveal the Edit icon. On mobile (Android, iOS), tap the request to show the Edit option.
270+
N> **Interaction**: On desktop (Windows, macOS), hover over a request to reveal the Edit icon. On mobile (Android, iOS), tap the request to show the Edit option.
271271

272272
![Edit Option in .NET MAUI AI AssistView](Images/working-with-aiassistview/maui-aiassistview-editoption.gif)
273273

@@ -276,7 +276,7 @@ N> Interaction: On desktop (Windows, macOS), hover over a request to reveal the
276276
The `SfAIAssistView` control allows you to fully customize the editor's appearance by using the [EditorViewTemplate](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.AIAssistView.SfAIAssistView.html#Syncfusion_Maui_AIAssistView_SfAIAssistView_EditorViewTemplate) property. This property lets you define a custom layout and style for the editor.
277277

278278
{% tabs %}
279-
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="13" %}
279+
{% highlight xaml hl_lines="13" %}
280280

281281
<ContentPage.Resources>
282282
<ResourceDictionary>
@@ -340,14 +340,14 @@ public partial class MainPage : ContentPage
340340
The `SfAIAssistView` can display a quick action icon inside the editor. To enable the action button, set the `ShowActionButtons` property to `true`.
341341

342342
{% tabs %}
343-
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="2" %}
343+
{% highlight xaml hl_lines="2" %}
344344

345345
<syncfusion:SfAIAssistView x:Name="sfAIAssistView"
346346
ShowActionButtons="True" />
347347

348348
{% endhighlight %}
349349

350-
{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="10" %}
350+
{% highlight c# hl_lines="10" %}
351351

352352
using Syncfusion.Maui.AIAssistView;
353353

@@ -376,7 +376,7 @@ Bind the `ActionButtons` collection with one or more `ActionButton` items to pop
376376
- `CommandParameter`: Passes a parameter to the command when executed.
377377

378378
{% tabs %}
379-
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="4 5 6 7 8" %}
379+
{% highlight xaml hl_lines="4 5 6 7 8" %}
380380

381381
<syncfusion:SfAIAssistView x:Name="sfAIAssistView"
382382
ShowActionButtons="True"
@@ -390,7 +390,7 @@ Bind the `ActionButtons` collection with one or more `ActionButton` items to pop
390390

391391
{% endhighlight %}
392392

393-
{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="15 17 23 29" %}
393+
{% highlight c# hl_lines="15 17 23 29" %}
394394

395395
using Syncfusion.Maui.AIAssistView;
396396

@@ -1008,14 +1008,14 @@ public partial class MainPage : ContentPage
10081008
The `SfAIAssistView` control provides an option to display a scroll-to-bottom button that helps users quickly navigate back to the latest responses when they have scrolled up in the AI conversation. To enable this, set the `ShowScrollToBottomButton` property to `true`.
10091009

10101010
{% tabs %}
1011-
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="3" %}
1011+
{% highlight xaml hl_lines="3" %}
10121012

10131013
<syncfusion:SfAIAssistView x:Name="sfAIAssistView"
10141014
AssistItems="{Binding AssistItems}"
10151015
ShowScrollToBottomButton="True" />
10161016

10171017
{% endhighlight %}
1018-
{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="10" %}
1018+
{% highlight c# hl_lines="10" %}
10191019

10201020
using Syncfusion.Maui.AIAssistView;
10211021

@@ -1041,7 +1041,7 @@ public partial class MainPage : ContentPage
10411041
The `SfAIAssistView` control allows you to fully customize the scroll-to-bottom button appearance by using the `ScrollToBottomButtonTemplate` property. This property lets you define a custom layout and style.
10421042

10431043
{% tabs %}
1044-
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="12" %}
1044+
{% highlight xaml hl_lines="12" %}
10451045

10461046
<ContentPage.Resources>
10471047
<ResourceDictionary>
@@ -1057,7 +1057,7 @@ The `SfAIAssistView` control allows you to fully customize the scroll-to-bottom
10571057
ScrollToBottomButtonTemplate="{StaticResource scrollToBottomButtonTemplate}" />
10581058

10591059
{% endhighlight %}
1060-
{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="10" %}
1060+
{% highlight c# hl_lines="11" %}
10611061

10621062
using Syncfusion.Maui.AIAssistView;
10631063

0 commit comments

Comments
 (0)