Silverlight 4/5 OOB 窗口菜单
我一直在考虑使用 Silverlight 来构建一个“跨平台”桌面应用程序(无论如何,Windows 和 Mac),但有一个问题我无法找到解决方法。在 Mac OS 上的 Adobe AIR 中,AIR 应用程序可以修改 Mac OS 菜单栏上的主窗口菜单(文件、编辑、视图、帮助等)。我无法找到从 Silverlight OOB 执行此操作的方法。
对于 Windows 显然我可以直接在 XAML 中制作自己的菜单并使用它。然而,这根本不适合 Mac 操作系统,对于 Mac 用户来说,它看起来非常时髦。对于很多人来说,这可能不是一个令人震惊的事情,但对我来说却是。我可以做些什么来避免等待 Microsoft 实施它呢? (我怀疑他们会这么做。)
我唯一能想到的就是构建我自己的 OS X 应用程序,其中包含一个带有 WebView 的窗口,然后将其导航到我的 silverlight 应用程序。然而,在那一刻我失去了完全的信任,这真的很糟糕。
I was looking at Silverlight for building a "cross platform" desktop application (Windows and Mac anyway), but there is one show stopper that I cannot find a workaround for. On the Mac OS, in Adobe AIR, the AIR apps have a way to modify the main window's menu on the Mac OS's menu bar (File, Edit, View, Help, etc). I cannot find a way to do this from a Silverlight OOB.
For Windows obviously I could just make my own menu right in XAML and use that. However, this does not fit in at all with the Mac OS and it will look very funky to Mac users. This may not be a show stopper for many people, but for me it is. What can I possibly do to get around this short of waiting for Microsoft to implement it? (Which I doubt they ever will.)
The only thing I can think of is to build my own OS X app with a single window that has a WebView in it and then navigate that to my silverlight app. However, I lose full trust elevation at that point which really sucks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 XAML 中创建菜单栏,但仅当您在 Windows 上运行时才显示它。
有关如何判断您是否在 Mac 上运行。
Create the menu bar in XAML, but only show it if you're running on Windows.
See https://stackoverflow.com/a/1429517/270348 for code about how to tell whether or not you're running on Mac.