1 Star 4 Fork 1

KnifeZ / KnifeZ.Byeol

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
App.xaml.cs 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
using Prism.Ioc;
using KnifeZ.Byeol.Views;
using System.Windows;
using Hardcodet.Wpf.TaskbarNotification;
namespace KnifeZ.Byeol
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
private TaskbarIcon notifyIcon;
protected override Window CreateShell()
{
return Container.Resolve<MainWindow>();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
#region 任务栏图标
notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath);
#endregion
}
protected override void OnExit(ExitEventArgs e)
{
notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner
base.OnExit(e);
}
}
}
1
https://gitee.com/KnifeZ/KnifeZ.Byeol.git
git@gitee.com:KnifeZ/KnifeZ.Byeol.git
KnifeZ
KnifeZ.Byeol
KnifeZ.Byeol
master

搜索帮助