How to set the AnimationEffects for NotifyIcon in WPF?
To set the Animation effect for the Notify Icon, the BalloonTipAnimationEffect property can be used. The BalloonTipAnimationEffect property contains different values such as
- Fade
- Custom
- Slide
- Scale
The following code snippet demonstrates how to set the BalloonTipAnimationEffect as Fade. Similarly, the different types of AnimationEffect for the NotifyIcon can be set using the BalloonTipAnimationEffect.
XAML:
<Window x:Class="DockingManager_New.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" Title="MainWindow" Height="350" Width="525"> <Grid x:Name="Grid1"> <Button x:Name="Button1" Width="100" Height="23" Click="Button1_Click" Content="ClickToShow"/> <syncfusion:NotifyIcon x:Name="NotifyIcon" BalloonTipText="Custom Notify Icon is Available" BalloonTipTitle="Default NotifyIcon" BalloonTipAnimationEffect="Fade" ShowBalloonTipTime="100" /> </Grid> </Window>
C#:
using Syncfusion.Windows.Tools.Controls;
namespace DockingManager_New
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button1_Click(object sender, RoutedEventArgs e)
{
//The following code shows how to set the AnimationEffect for NotifyIcon
NotifyIcon.BalloonTipAnimationEffect = BalloonTipAnimationEffects.Fade;
NotifyIcon.BalloonTipTitle = "Default NotifyIcon";
NotifyIcon.BalloonTipText = "Custom Notify Icon is Available";
NotifyIcon.ShowBalloonTip(100);}
}
}
Conclusion
I hope you enjoyed learning about how to set the AnimationEffects for NotifyIcon in WPF.
You can refer to our WPF Notify Icon feature tour page to know about its other groundbreaking feature representations. You can also explore our documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!