Silverlight 4/5 OOB Window Menu
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 开发者_StackOverflow社区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.
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.
精彩评论