mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-16 17:28:43 -05:00
Added .NET 5.0 and restructured the repository. (#47)
This commit is contained in:
27
src/NotifyIconWpf.Sample.Windowless/App.xaml.cs
Normal file
27
src/NotifyIconWpf.Sample.Windowless/App.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Windows;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace NotifyIconWpf.Sample.Windowless
|
||||
{
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user