Methods in .NET MAUI AI-Powered Scheduler (SfSmartScheduler)
18 Nov 20183 minutes to read
The SfSmartScheduler control provides three methods for programmatically managing the AI assistant view:
-
ResetAssistView — Clears the assistant view and resets it to its initial state (
void) -
CloseAssistView — Hides the AI assistant panel (
void) -
OpenAssistView — Displays the AI assistant panel (
void)
All methods are synchronous and do not require parameters or throw exceptions under normal conditions.
Reset AI Assistant View
The ResetAssistView method clears the AI assistant view and resets it to its initial state. Use this to start a new conversation or clear previous assistant interactions.
<ContentPage
. . .
xmlns:smartScheduler="clr-namespace:Syncfusion.Maui.SmartScheduler;assembly=Syncfusion.Maui.SmartScheduler">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<smartScheduler:SfSmartScheduler x:Name="smartScheduler" Grid.Row="0"/>
<Button Grid.Row="1" Text="Reset Assistant" Clicked="OnResetClicked"/>
</Grid>
</ContentPage>using Syncfusion.Maui.SmartScheduler;
. . .
private void OnResetClicked(object sender, EventArgs e)
{
this.smartScheduler.ResetAssistView();
}Close AI Assistant View
The CloseAssistView method hides the AI assistant panel while preserving its state. The assistant view can be reopened later without losing the current conversation.
<ContentPage
. . .
xmlns:smartScheduler="clr-namespace:Syncfusion.Maui.SmartScheduler;assembly=Syncfusion.Maui.SmartScheduler">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<smartScheduler:SfSmartScheduler x:Name="smartScheduler" Grid.Row="0"/>
<Button Grid.Row="1" Text="Close Assistant" Clicked="OnCloseClicked"/>
</Grid>
</ContentPage>using Syncfusion.Maui.SmartScheduler;
. . .
private void OnCloseClicked(object sender, EventArgs e)
{
this.smartScheduler.CloseAssistView();
}Open AI Assistant View
The OpenAssistView method displays the AI assistant panel. Use this after calling CloseAssistView to reopen the assistant, or to programmatically trigger the assistant display in response to user actions.
<ContentPage
. . .
xmlns:smartScheduler="clr-namespace:Syncfusion.Maui.SmartScheduler;assembly=Syncfusion.Maui.SmartScheduler">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<smartScheduler:SfSmartScheduler x:Name="smartScheduler" Grid.Row="0"/>
<Button Grid.Row="1" Text="Open Assistant" Clicked="OnOpenClicked"/>
</Grid>
</ContentPage>using Syncfusion.Maui.SmartScheduler;
. . .
private void OnOpenClicked(object sender, EventArgs e)
{
this.smartScheduler.OpenAssistView();
}