Message 1 of 7
MainWindow to System.Windows.Window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to set the OwnerWindow-proerty on our License system to ensure that any dialog from the license system is displayed in the foreground. This system expects a System.Windows.Window object, but AutoCAD only provides a Autodesk.AutoCAD.Windows.Window-property as far as I can see (Application.MainWindow)
So I've tried casting it, to no luck, and I've tried to convert it using: HwndSource.FromHwnd(Application.MainWindow.Handle); -But it returns null.
Is there another way this can be done?
(I have one work-around wich uses Application.ShowModelessWindow on a temp wpf window, which in turn is used as owner window for the license system, but it's less than ideal..