Events in .NET MAUI Effects View (SfEffectsView)
22 May 20253 minutes to read
AnimationCompleted event
The AnimationCompleted event occurs when the rendered effects have been completed.
<ContentPage
xmlns:effectsView="clr-namespace:Syncfusion.Maui.Toolkit.EffectsView;assembly=Syncfusion.Maui.Toolkit">
<ContentPage.Content>
<effectsView:SfEffectsView
TouchDownEffects="Ripple"
AnimationCompleted="AnimationCompleted"/>
</ContentPage.Content>
</ContentPage>using Syncfusion.Maui.Toolkit.EffectsView;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var effectsView = new SfEffectsView
{
TouchDownEffects = SfEffects.Ripple
};
effectsView.AnimationCompleted += AnimationCompleted;
this.Content = effectsView;
}
private void AnimationCompleted(object sender, EventArgs e)
{
}
}NOTE
When the effects are rendered on direct interaction, the AnimationCompleted event occurs on touch up, and when it is applied programmatically, it is triggered immediately on completion of effects.
NOTE
The AnimationCompleted event is not applicable for SfEffects.Selection.
SelectionChanged event
The SelectionChanged event occurs when SfEffectsView is selected or unselected.
<ContentPage
xmlns:effectsView="clr-namespace:Syncfusion.Maui.Toolkit.EffectsView;assembly=Syncfusion.Maui.Toolkit">
<ContentPage.Content>
<effectsView:SfEffectsView
LongPressEffects="Selection"
SelectionChanged="SelectionChanged"
TouchDownEffects="None"
TouchUpEffects="None"/>
</ContentPage.Content>
</ContentPage>using Syncfusion.Maui.Toolkit.EffectsView;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var effectsView = new SfEffectsView
{
LongPressEffects = SfEffects.Selection,
TouchDownEffects = SfEffects.None,
TouchUpEffects = SfEffects.None
};
effectsView.SelectionChanged += SelectionChanged;
this.Content = effectsView;
}
private void SelectionChanged(object sender, EventArgs e)
{
}
}NOTE
The SelectionChanged event triggers both on rendering SfEffects.Selection by direct interaction and on changing the IsSelected property of SfEffectsView.