Skip to content

Commit d52e45e

Browse files
committed
Modified the proper suggested prompts code
1 parent 63e9147 commit d52e45e

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

MAUI/SmartScheduler/working-with-smart-scheduler.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,42 @@ this.Content = smartScheduler;
206206
The assist view suggested prompts can be customized by using the `SuggestedPrompts` property of the `AssistViewSettings`. By default, the `SuggestedPrompts` property is set to null.
207207

208208
{% tabs %}
209-
{% highlight XAML hl_lines="4" %}
209+
{% highlight XAML hl_lines="8" %}
210+
211+
<ContentPage.BindingContext>
212+
<local:ViewModel/>
213+
</ContentPage.BindingContext>
210214

211215
<smartScheduler:SfSmartScheduler x:Name="smartScheduler">
212216
<smartScheduler:SfSmartScheduler.AssistViewSettings >
213-
<smartScheduler:SchedulerAssistViewSettings ShowAssistViewBanner="True">
214-
<smartScheduler:SchedulerAssistViewSettings.SuggestedPrompts>
215-
<x:Array Type="{x:Type x:String}">
216-
<x:String>Find free slots</x:String>
217-
<x:String>Create a meeting</x:String>
218-
<x:String>Summarize today</x:String>
219-
</x:Array>
220-
</smartScheduler:SchedulerAssistViewSettings.SuggestedPrompts>
221-
</smartScheduler:SchedulerAssistViewSettings>
217+
<smartScheduler:SchedulerAssistViewSettings ShowAssistViewBanner="True" SuggestedPrompts="{Binding SuggestedPrompts}"/>
222218
</smartScheduler:SfSmartScheduler.AssistViewSettings>
223219
</smartScheduler:SfSmartScheduler>
224220

221+
{% endhighlight %}
222+
{% highlight C# tabtitle="ViewModel.cs" %}
223+
224+
public class ViewModel
225+
{
226+
private List<string> suggestedPrompts;
227+
228+
public List<string> SuggestedPrompts
229+
{
230+
get { return suggestedPrompts; }
231+
set { suggestedPrompts = value; }
232+
}
233+
234+
public ViewModel()
235+
{
236+
this.suggestedPrompts = new List<string>()
237+
{
238+
"Schedule meeting",
239+
"Set reminder",
240+
"Book appointment"
241+
};
242+
}
243+
}
244+
225245
{% endhighlight %}
226246
{% highlight C# hl_lines="4 5 6 7 8 9" %}
227247

0 commit comments

Comments
 (0)