只有托盘图标的 WPF 应用程序 [英] WPF Application that only has a tray icon

查看:34
本文介绍了只有托盘图标的 WPF 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个完全的 WPF 新手,想知道是否有人能给我一些指导,如何编写一个开始最小化到托盘的应用程序.这个想法是它会定期获取一个 RSS 提要,并在有新提要时创建一个 Toaster-Popup.

应用程序仍然应该有一个主窗口(本质上只是一个包含所有提要条目的列表),但默认情况下应该是隐藏的.

我已经开始阅读有关 XAML 和 WPF 的内容,并且我知道 App.xaml 中的 StartupUri 必须指向我的主窗口,但我不知道执行 SysTray 图标并隐藏主窗口的正确方法是什么(这也意味着当用户最小化窗口时,它应该最小化到托盘,而不是任务栏).

有什么提示吗?

解决方案

WPF 没有 NotifyIcon.

我的一个同事使用了这个免费提供的库,效果很好:

  • I am a total WPF newbie and wonder if anyone could give me some pointers how to write an application that starts minimized to tray. The idea is that it periodically fetches an RSS Feed and creates a Toaster-Popup when there are new feeds.

    The Application should still have a Main Window (essentially just a list containing all feed entries), but that should be hidden by default.

    I have started reading about XAML and WPF and I know that the StartupUri in the App.xaml has to point to my main window, but I have no idea what the proper way is to do the SysTray icon and hide the main window (this also means that when the user minimizes the window, it should minimize to tray, not to taskbar).

    Any hints?

    解决方案

    There's no NotifyIcon for WPF.

    A colleague of mine used this freely available library to good effect:

    这篇关于只有托盘图标的 WPF 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆