You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
App.xaml 不指定主窗口的情况下,直接启动托盘。目前实现不了。
Describe the solution you'd like
A clear and concise description of what you want to happen.
以下代码我测试了,可以显示icon,但是右键无法弹出contextMenu。
public partial class App : Application
{
NotifyIcon _notifyIcon = null;
protected override void OnStartup(StartupEventArgs e)
{
string apptEntryDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
string iconPath = Path.Combine(apptEntryDir, "Assets\\Img\\logo.ico");
ContextMenu menu = new ContextMenu();
menu.Items.Add(new MenuItem() { Header = "主界面" });
menu.Items.Add(new MenuItem() { Header = "退出", Command = ControlCommands.ShutdownApp });
_notifyIcon = new NotifyIcon()
{
Token = "token",
Icon = new BitmapImage(new Uri(iconPath, UriKind.Absolute)),
ContextMenu = menu
};
_notifyIcon.Init();
base.OnStartup(e);
}
}
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Activity
GiantappMan commentedon Mar 29, 2021
能更新一个nuget版本么,感谢
GF-Huang commentedon May 7, 2021
Same issue. Is it fixed and release to NuGet?
NaBian commentedon May 8, 2021
https://www.myget.org/feed/handycontrol/package/nuget/HandyControl
GF-Huang commentedon May 8, 2021
有无可能直接在
app.xaml中定义NotifyIcon而不用手写 C# 代码去定义?fixed HandyOrg#748