WPF Control Resolution problem with Revit MainWindowHandle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Community,
I have a WPF Page Control which switches between Modeless Dialog Window (WPF) and DockablePane in Revit.
- Modeless Dialog Window - in Zero-Document State
- DockablePane - at least one Document activated
The problem I have is the COntrol resolution on screen. With DockablePane all WPF Controls in my Page look extremly sharp however once Page is switched to Modeless Dialog Window, WPF Controls get blurry and not sharp.
I have assigned Revit MainWindowHangle as the Owner of my Modeless WPF Window:
//Method in WpfWindow class
public void AssignOwner(UIApplication UiApp)
{
IntPtr RevitMainWindowHandle = UiApp.MainWindowHandle;
WindowInteropHelper helper = new WindowInteropHelper(this);
helper.Owner = RevitMainWindowHandle;
}
//Window Owner assigned OnApplicationInitialized
private void OnApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e)
{
myModelessWpfWindow.AssignOwner(UiApp);
}
Does anyone encounter similar problem or know what could be the Cause / Solution?
Any help much appreciated,
Lukasz