@@ -270,12 +270,14 @@ public class ViewModel
270270{% endhighlight %}
271271{% endtabs %}
272272
273+ ![ Assist view suggested propmts in .NET MAUI Smart Scheduler.] ( images/working-with-smart-scheduler/maui-smart-scheduler-assist-view-suggested-prompts.png )
274+
273275### Show assist view banner
274276
275277The assist view banner visibility can be customized by using the ` ShowAssistViewBanner ` property of the ` AssistViewSettings ` . By default, the ` ShowAssistViewBanner ` property is set to false.
276278
277279{% tabs %}
278- {% highlight XAML tabtitle="MainPage.xaml" hl_lines="4 " %}
280+ {% highlight XAML tabtitle="MainPage.xaml" hl_lines="3 " %}
279281
280282<smartScheduler: SfSmartScheduler x: Name ="smartScheduler">
281283 < smartScheduler:SfSmartScheduler.AssistViewSettings >
@@ -286,27 +288,32 @@ The assist view banner visibility can be customized by using the `ShowAssistView
286288{% endhighlight %}
287289{% highlight C# tabtitle="MainPage.xaml.cs" hl_lines="3" %}
288290
289- SfSmartScheduler smartScheduler = new SfSmartScheduler();
290- smartScheduler.AssistViewSettings = new SchedulerAssistViewSettings();
291- smartScheduler.AssistViewSettings.ShowAssistViewBanner = true;
292- smartScheduler.AssistViewSettings.AssistViewBannerTemplate = new DataTemplate(() =>
291+ this.smartScheduler.AssistViewSettings.AssistViewBannerTemplate = new DataTemplate(() =>
293292{
294- return new Grid
293+ var grid = new Grid
295294 {
296- Padding = 6,
297- BackgroundColor = Color.FromArgb("#EEF2FF"),
298- Children =
299- {
300- new Label
301- {
302- Text = "Try asking: 'Create a standup at 10 AM'",
303- FontAttributes = FontAttributes.Bold,
304- TextColor = Color.FromArgb("#1C1B1F")
305- }
306- }
295+ Padding = new Thickness(16),
296+ Margin = new Thickness(0, 40, 0, 0),
297+ BackgroundColor = Color.FromArgb("#E9EEFF"),
298+ HorizontalOptions = LayoutOptions.Center,
299+ VerticalOptions = LayoutOptions.Start
307300 };
301+
302+ var label = new Label
303+ {
304+ Text = "Hi! I’m your personalized assistant.\nHow can I help you?",
305+ HorizontalTextAlignment = TextAlignment.Center,
306+ VerticalTextAlignment = TextAlignment.Center,
307+ TextColor = Color.FromArgb("#1C1B1F"),
308+ FontSize = 16,
309+ Padding = new Thickness(10),
310+ FontAttributes = FontAttributes.None
311+ };
312+
313+ grid.Children.Add(label);
314+
315+ return grid;
308316});
309- this.Content = smartScheduler;
310317
311318{% endhighlight %}
312319{% endtabs %}
@@ -320,15 +327,36 @@ The `SfSmartScheduler` facilitates the customization of both header and banner t
320327The assist view header appearance can be customized by using the ` AssistViewHeaderTemplate ` property of the ` AssistViewSettings ` .
321328
322329{% tabs %}
323- {% highlight xaml tabtitle="MainPage.xaml" hl_lines="5 6 7 8 9 10 11" %}
330+ {% highlight xaml tabtitle="MainPage.xaml" %}
324331
325332<smartScheduler: SfSmartScheduler x: Name ="smartScheduler">
326333 < smartScheduler:SfSmartScheduler.AssistViewSettings >
327334 < smartScheduler:SchedulerAssistViewSettings >
328335 < smartScheduler:SchedulerAssistViewSettings.AssistViewHeaderTemplate >
329336 <DataTemplate >
330- <Grid Padding =" 8 " >
331- <Label Text =" AI Assistant " FontAttributes =" Bold " />
337+ <Grid BackgroundColor="LightYellow"
338+ ColumnDefinitions="40,* ,40,40">
339+ <Label Text="✦"
340+ FontSize="20"
341+ VerticalTextAlignment="Center"
342+ HorizontalTextAlignment="Center"
343+ Grid.Column="0" />
344+ <Label Text="Smart Scheduler"
345+ FontAttributes="Bold"
346+ FontSize="16"
347+ VerticalTextAlignment="Center"
348+ HorizontalTextAlignment="Start"
349+ Grid.Column="1" />
350+ <Label Text="⟳"
351+ FontSize="20"
352+ VerticalTextAlignment="Center"
353+ HorizontalTextAlignment="Center"
354+ Grid.Column="2" />
355+ <Label Text="✕"
356+ FontSize="20"
357+ VerticalTextAlignment="Center"
358+ HorizontalTextAlignment="Center"
359+ Grid.Column="3" />
332360 </Grid >
333361 </DataTemplate >
334362 </smartScheduler: SchedulerAssistViewSettings .AssistViewHeaderTemplate>
@@ -343,40 +371,91 @@ SfSmartScheduler smartScheduler = new SfSmartScheduler();
343371smartScheduler.AssistViewSettings = new SchedulerAssistViewSettings();
344372smartScheduler.AssistViewSettings.AssistViewHeaderTemplate = new DataTemplate(() =>
345373{
346- return new Grid
374+ var grid = new Grid
347375 {
348- Padding = 8 ,
349- Children =
376+ BackgroundColor = Colors.LightYellow ,
377+ ColumnDefinitions =
350378 {
351- new Label
352- {
353- Text = "AI Assistant",
354- FontAttributes = FontAttributes.Bold
355- }
379+ new ColumnDefinition { Width = 40 },
380+ new ColumnDefinition { Width = GridLength.Star },
381+ new ColumnDefinition { Width = 40 },
382+ new ColumnDefinition { Width = 40 }
356383 }
357384 };
385+
386+ var symbol = new Label
387+ {
388+ Text = "✦",
389+ FontSize = 20,
390+ VerticalTextAlignment = TextAlignment.Center,
391+ HorizontalTextAlignment = TextAlignment.Center
392+ };
393+ grid.Children.Add(symbol);
394+ Grid.SetColumn(symbol, 0);
395+
396+ var title = new Label
397+ {
398+ Text = "Smart Scheduler",
399+ FontAttributes = FontAttributes.Bold,
400+ FontSize = 16,
401+ VerticalTextAlignment = TextAlignment.Center,
402+ HorizontalTextAlignment = TextAlignment.Start
403+ };
404+ grid.Children.Add(title);
405+ Grid.SetColumn(title, 1);
406+
407+ var reset = new Label
408+ {
409+ Text = "⟳",
410+ FontSize = 20,
411+ VerticalTextAlignment = TextAlignment.Center,
412+ HorizontalTextAlignment = TextAlignment.Center
413+ };
414+ grid.Children.Add(reset);
415+ Grid.SetColumn(reset, 2);
416+
417+ var close = new Label
418+ {
419+ Text = "✕",
420+ FontSize = 20,
421+ VerticalTextAlignment = TextAlignment.Center,
422+ HorizontalTextAlignment = TextAlignment.Center
423+ };
424+ grid.Children.Add(close);
425+ Grid.SetColumn(close, 3);
426+
427+ return grid;
358428});
359429this.Content = smartScheduler;
360430
361431{% endhighlight %}
362432{% endtabs %}
363433
434+ ![ Assist view header template in .NET MAUI Smart Scheduler.] ( images/working-with-smart-scheduler/maui-smart-scheduler-assist-view-header-template.png )
435+
364436### Customize assist view banner appearance using DataTemplate
365437
366438The assist view banner appearance can be customized by using the ` AssistViewBannerTemplate ` property of the ` AssistViewSettings ` .
367439
368440{% tabs %}
369- {% highlight xaml tabtitle="MainPage.xaml" hl_lines="5 6 7 8 9 10 11 12 13" %}
441+ {% highlight xaml tabtitle="MainPage.xaml" hl_lines="4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 " %}
370442
371443<smartScheduler: SfSmartScheduler x: Name ="smartScheduler">
372444 < smartScheduler:SfSmartScheduler.AssistViewSettings >
373445 <smartScheduler: SchedulerAssistViewSettings ShowAssistViewBanner="True">
374- < smartScheduler:SchedulerAssistViewSettings.AssistViewBannerTemplate >
446+ < smartScheduler:SchedulerAssistViewSettings.AssistViewBannerTemplate >
375447 <DataTemplate >
376- <Grid Padding =" 6 " BackgroundColor =" #EEF2FF " >
377- <Label Text="Try asking: 'Create a standup at 10 AM'"
378- FontAttributes="Bold"
379- TextColor="#1C1B1F" />
448+ <Grid Padding="16"
449+ Margin="0,40,0,0"
450+ BackgroundColor="#E9EEFF"
451+ HorizontalOptions="Center"
452+ VerticalOptions="Start">
453+ <Label Text="Hi ! I’m your personalized assistant.
 ; How can I help you ?"
454+ HorizontalTextAlignment="Center"
455+ VerticalTextAlignment="Center"
456+ TextColor="#1C1B1F"
457+ FontSize="16"
458+ Padding="10" />
380459 </Grid >
381460 </DataTemplate >
382461 </smartScheduler: SchedulerAssistViewSettings .AssistViewBannerTemplate>
@@ -392,22 +471,32 @@ smartScheduler.AssistViewSettings = new SchedulerAssistViewSettings();
392471smartScheduler.AssistViewSettings.ShowAssistViewBanner = true;
393472smartScheduler.AssistViewSettings.AssistViewBannerTemplate = new DataTemplate(() =>
394473{
395- return new Grid
474+ var grid = new Grid
396475 {
397- Padding = 6,
398- BackgroundColor = Color.FromArgb("#EEF2FF"),
399- Children =
400- {
401- new Label
402- {
403- Text = "Try asking: 'Create a standup at 10 AM'",
404- FontAttributes = FontAttributes.Bold,
405- TextColor = Color.FromArgb("#1C1B1F")
406- }
407- }
476+ Padding = new Thickness(16),
477+ Margin = new Thickness(0, 40, 0, 0),
478+ BackgroundColor = Color.FromArgb("#E9EEFF"),
479+ HorizontalOptions = LayoutOptions.Center,
480+ VerticalOptions = LayoutOptions.Start
408481 };
482+
483+ var label = new Label
484+ {
485+ Text = "Hi! I’m your personalized assistant.\nHow can I help you?",
486+ HorizontalTextAlignment = TextAlignment.Center,
487+ VerticalTextAlignment = TextAlignment.Center,
488+ TextColor = Color.FromArgb("#1C1B1F"),
489+ FontSize = 16,
490+ Padding = new Thickness(10),
491+ FontAttributes = FontAttributes.None
492+ };
493+
494+ grid.Children.Add(label);
495+ return grid;
409496});
410497this.Content = smartScheduler;
411498
412499{% endhighlight %}
413- {% endtabs %}
500+ {% endtabs %}
501+
502+ ![ Assist view banner template in .NET MAUI Smart Scheduler.] ( images/working-with-smart-scheduler/maui-smart-scheduler-assist-view-banner-template.png )
0 commit comments