Files
wpf-notifyicon/Source/Windowless Sample/App.xaml.cs
Philipp Sumi 26e8db45da ADD Sample for windowless application.
NTFY-25

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@203 9f600761-6f11-4665-b6dc-0185e9171623
2013-11-23 02:10:17 +00:00

28 lines
787 B
C#

using System.Windows;
using Hardcodet.Wpf.TaskbarNotification;
namespace Windowless_Sample
{
/// <summary>
/// Simple application. Check the XAML for comments.
/// </summary>
public partial class App : Application
{
private TaskbarIcon notifyIcon;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
//create the notifyicon (it's a resource declared in NotifyIconResources.xaml
notifyIcon = (TaskbarIcon) FindResource("NotifyIcon");
}
protected override void OnExit(ExitEventArgs e)
{
notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner
base.OnExit(e);
}
}
}