Skip to content

Commit 928a103

Browse files
Merge pull request #1660 from syncfusion-content/development
DOCINFRA-2341_merged_using_automation
2 parents 8840b58 + 0bd25f4 commit 928a103

File tree

77 files changed

+1008
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1008
-210
lines changed

wpf-toc.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,15 @@
13211321
<li><a href="/wpf/Navigation-Drawer/Custom-views">Custom views</a></li>
13221322
</ul>
13231323
</li>
1324+
<li>
1325+
NotifyIcon
1326+
<ul>
1327+
<li><a href="/wpf/Notify-Icon/overview">Overview</a></li>
1328+
<li><a href="/wpf/Notify-Icon/getting-started">Getting Started</a></li>
1329+
<li><a href="/wpf/Notify-Icon/interactive-features">Interactive Features</a></li>
1330+
<li><a href="/wpf/Notify-Icon/layout-related-features">Layout Related Features</a></li>
1331+
</ul>
1332+
</li>
13241333
<li>
13251334
OlapChart
13261335
<ul>
@@ -1539,6 +1548,7 @@
15391548
<li><a href="/wpf/Pdf-Viewer/acquiring-current-page-being-displayed">Acquire current page being displayed</a></li>
15401549
<li><a href="/wpf/Pdf-Viewer/enabling-and-disabling-notification-bar">Enable and Disable Notification bar</a></li>
15411550
<li><a href="/wpf/Pdf-Viewer/how-to/Disable-the-Undo-Redo-operation">Disable the Undo Redo operation</a></li>
1551+
<li><a href="/wpf/Pdf-Viewer/how-to/Unload-the-document">Unload the document</a></li>
15421552
</ul>
15431553
</li>
15441554
</ul>
@@ -2122,7 +2132,7 @@
21222132
<li><a href="/wpf/TreeMap/selection-support">Selection Support</a></li>
21232133
<li><a href="/wpf/TreeMap/customizing-leaf-nodes">Customizing Leaf Nodes</a></li>
21242134
<li><a href="/wpf/TreeMap/drill-down-support">Drill Down Support</a></li>
2125-
<li><a href="/wpf/TreeMap/accessibility ">Accessibility</a></li>
2135+
<li><a href="/wpf/TreeMap/accessibility">Accessibility</a></li>
21262136
</ul>
21272137
</li>
21282138
<li>
@@ -2344,15 +2354,6 @@
23442354
<li><a href="/wpf/classic/gridtree/interactive-features">Interactive Features</a></li>
23452355
</ul>
23462356
</li>
2347-
<li>
2348-
NotifyIcon (Classic)
2349-
<ul>
2350-
<li><a href="/wpf/classic/Notify-Icon/overview">Overview</a></li>
2351-
<li><a href="/wpf/classic/Notify-Icon/getting-started">Getting Started</a></li>
2352-
<li><a href="/wpf/classic/Notify-Icon/interactive-features">Interactive Features</a></li>
2353-
<li><a href="/wpf/classic/Notify-Icon/layout-related-features">Layout Related Features</a></li>
2354-
</ul>
2355-
</li>
23562357
<li>
23572358
TreeViewAdv (Classic)
23582359
<ul>

wpf/AI-AssistView/Getting-started.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
layout: post
3+
title: Getting Started with WPF AI AssistView control | Syncfusion
4+
description: Learn about getting started with the Syncfusion WPF AI AssistView (SfAIAssistView) control with its basic features.
5+
platform: wpf
6+
control: AI AssistView
7+
documentation: ug
8+
---
9+
10+
# Getting Started with WPF AI AssistView
11+
12+
This section explains the steps required to add the Wpf [SfAIAssistView](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Chat.SfAIAssistView.html) control with its basic features.
13+
14+
## Structure of SfAIAssistView
15+
16+
![WPF SfAIAssistView Structure](aiassistview_images/wpf_aiassistview_control_structure.png)
17+
18+
## Adding WPF SfAIAssistview via xaml
19+
20+
1. Create a [Wpf desktop app for C# and .NET 6](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/get-started/create-app-visual-studio?view=netdesktop-9.0).
21+
2. Add reference to [Syncfusion.SfChat.Wpf](https://www.nuget.org/packages/Syncfusion.SfChat.Wpf) NuGet.
22+
3. Import the control namespace `Syncfusion.UI.Xaml.Chat` in XAML or C# code.
23+
4. Initialize the [SfAIAssistView](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Chat.SfAIAssistView.html) control.
24+
25+
{% tabs %}
26+
{% highlight xaml %}
27+
28+
<Page
29+
x:Class="GettingStarted.MainPage"
30+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
31+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
32+
xmlns:local="using:GettingStarted"
33+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
34+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
35+
xmlns:syncfusion="using:Syncfusion.UI.Xaml.Chat"
36+
mc:Ignorable="d"
37+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
38+
<Grid>
39+
<syncfusion:SfAIAssistView />
40+
</Grid>
41+
</Page>
42+
43+
{% endhighlight %}
44+
{% endtabs %}
45+
46+
## Adding WPF SfAIAssistview via C#
47+
48+
1. Create a [Wpf desktop app for C# and .NET 6](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/get-started/create-app-visual-studio?view=netdesktop-9.0).
49+
2. Add reference to [Syncfusion.SfChat.Wpf](https://www.nuget.org/packages/Syncfusion.SfChat.Wpf) NuGet.
50+
3. Import the control namespace `Syncfusion.UI.Xaml.Chat` in XAML or C# code.
51+
4. Initialize the [SfAIAssistView](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Chat.SfAIAssistView.html) control.
52+
53+
{% tabs %}
54+
{% highlight C# %}
55+
56+
using Syncfusion.UI.Xaml.Chat;
57+
58+
namespace GettingStarted
59+
{
60+
/// <summary>
61+
/// Interaction logic for MainWindow.xaml
62+
/// </summary>
63+
public partial class MainWindow : Window
64+
{
65+
public MainWindow()
66+
{
67+
this.InitializeComponent();
68+
// Creating an instance of the AIAssistView control
69+
SfAIAssistView assistView = new SfAIAssistView();
70+
grid.Children.Add(assistView);
71+
}
72+
}
73+
}
74+
75+
{% endhighlight %}
76+
{% endtabs %}
77+
78+
79+
## Creating ViewModel for AI AssistView
80+
81+
Create a simple chat collection as shown in the following code example in a new class file. Save it as ViewModel.cs file.
82+
83+
{% tabs %}
84+
{% highlight C# %}
85+
86+
public class ViewModel : INotifyPropertyChanged
87+
{
88+
private ObservableCollection<object> chats;
89+
private Author currentUser;
90+
public ViewModel()
91+
{
92+
this.Chats = new ObservableCollection<object>();
93+
this.CurrentUser = new Author { Name="John"};
94+
this.GenerateMessages();
95+
}
96+
97+
private async void GenerateMessages()
98+
{
99+
this.Chats.Add( new TextMessage { Author = CurrentUser, Text = "What is WPF?" } );
100+
await Task.Delay(1000);
101+
this.Chats.Add( new TextMessage { Author = new Author { Name = "Bot" }, Text = "WPF is a user interface layer that contains modern controls and styles for building Windows apps." });
102+
}
103+
104+
public ObservableCollection<object> Chats
105+
{
106+
get
107+
{
108+
return this.chats;
109+
}
110+
set
111+
{
112+
this.chats = value;
113+
RaisePropertyChanged("Messages");
114+
}
115+
}
116+
117+
public Author CurrentUser
118+
{
119+
get
120+
{
121+
return this.currentUser;
122+
}
123+
set
124+
{
125+
this.currentUser = value;
126+
RaisePropertyChanged("CurrentUser");
127+
}
128+
}
129+
130+
131+
public void RaisePropertyChanged(string propName)
132+
{
133+
if (PropertyChanged != null)
134+
{
135+
PropertyChanged(this, new PropertyChangedEventArgs(propName));
136+
}
137+
}
138+
139+
140+
public event PropertyChangedEventHandler PropertyChanged;
141+
}
142+
143+
{% endhighlight %}
144+
{% endtabs %}
145+
146+
## Bind Messages
147+
148+
Set the ViewModel as the DataContext for the AI AssistView or the parent window. This allows data binding between the UI and the ViewModel properties.
149+
To populate AI AssistView, bind the chats in ViewModel to Messages property of AI AssistView.
150+
151+
{% tabs %}
152+
{% highlight xaml %}
153+
154+
<Page
155+
x:Class="GettingStarted.MainPage"
156+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
157+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
158+
xmlns:local="using:GettingStarted"
159+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
160+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
161+
xmlns:syncfusion="using:Syncfusion.UI.Xaml.Chat"
162+
mc:Ignorable="d"
163+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
164+
<Grid>
165+
<Grid.DataContext>
166+
<local:ViewModel/>
167+
</Grid.DataContext>
168+
<syncfusion:SfAIAssistView CurrentUser="{Binding CurrentUser}"
169+
Messages="{Binding Chats}"/>
170+
</Grid>
171+
</Page>
172+
173+
{% endhighlight %}
174+
{% endtabs %}
175+
176+
![WPF AI AssistView control getting started](aiassistview_images/wpf_aiassistview_gettingstarted.png)

wpf/AI-AssistView/Suggestions.md

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,29 @@ documentation: ug
1111

1212
By using the [Suggestions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Chat.SfAIAssistView.html#Syncfusion_UI_Xaml_Chat_SfAIAssistView_Suggestions) property, the AssistView displays AI-driven suggestions in the bottom right corner, making it easy for users to quickly respond or choose from relevant options.
1313

14-
## Create a ViewModel class with suggestion property
14+
{% tabs %}
1515

16-
Create a simple suggestion collection as shown in the following code example in a new class file. Save it as ViewModel.cs file.
16+
{% highlight xaml %}
17+
18+
<Page
19+
x:Class="GettingStarted.MainPage"
20+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
21+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
22+
xmlns:local="using:GettingStarted"
23+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
24+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
25+
xmlns:syncfusion="using:Syncfusion.UI.Xaml.Chat"
26+
mc:Ignorable="d"
27+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
28+
<Grid>
29+
<syncfusion:SfAIAssistView CurrentUser="{Binding CurrentUser}"
30+
Suggestions="{Binding Suggestion}"
31+
Messages="{Binding Chats}"/>
32+
</Grid>
33+
</Page>
34+
35+
{% endhighlight %}
1736

18-
{% tabs %}
1937
{% highlight C# %}
2038

2139
public class ViewModel : INotifyPropertyChanged
@@ -94,35 +112,4 @@ Create a simple suggestion collection as shown in the following code example in
94112
}
95113

96114
{% endhighlight %}
97-
{% endtabs %}
98-
99-
100-
## Bind the Suggestion
101-
102-
{% tabs %}
103-
{% highlight xaml %}
104-
105-
<Page
106-
x:Class="GettingStarted.MainPage"
107-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
108-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
109-
xmlns:local="using:GettingStarted"
110-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
111-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
112-
xmlns:syncfusion="using:Syncfusion.UI.Xaml.Chat"
113-
mc:Ignorable="d"
114-
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
115-
<Grid>
116-
<Grid.DataContext>
117-
<local:ViewModel/>
118-
</Grid.DataContext>
119-
<syncfusion:SfAIAssistView CurrentUser="{Binding CurrentUser}"
120-
Suggestions="{Binding Suggestion}"
121-
Messages="{Binding Chats}"/>
122-
</Grid>
123-
</Page>
124-
125-
{% endhighlight %}
126-
{% endtabs %}
127-
128-
![WPF AI AssistView control suggestion](aiassistview_images/wpf_aiassistview_suggestions.png)
115+
{% endtabs %}

0 commit comments

Comments
 (0)