Problem with inconsistent tool window previews

Docking/MDI for WPF Forum

Posted 16 years ago by Craig - Varigence, Inc.
Version: 9.1.0500
Avatar
I'm continuing to play with the image preview system and have observed that image previews, for some ToolWindows, display different content under some circumstances. This seems to be a bug, as I'd expect the previews to show the same content for a ToolWindow. I'm going to describe my scenarios and repro steps below; if you need a sample application, please let me know and I can provide one via email.

Both scenarios involve a ToolWindowContainer that contains multiple ToolWindow elements. One ToolWindow contains a WPF UserControl that uses a WPF DataGrid (this is the datagrid from the WPF team's CodePlex site). The DataGrid has three columns. Another ToolWindow contains Mindscape's WPF Property Grid control. Both of these controls are bound to an object.

Repro Steps for Scenario 1:
1. I open my application and put the PropertyGrid ToolWindow up front (so the DataGrid ToolWindow is behind it).
2. I select an object so both controls display information.
3. I hit Ctrl+Tab to bring up the switcher.
4. I select the DataGrid control's ToolWindow under Active Tool Windows and see its image preview. I notice that the window's image is cut off in the preview, so that I see just the first two DataGrid columns.
5. I release Ctrl+Tab so the DataGrid ToolWindow moves to the front of the ToolWindow container.
6. I hit Ctrl+Tab again and notice that the DataGrid ToolWindow's image preview has now changed. Specifically, I can now see all three columns of the DataGrid.

Thus, it seems that moving the ToolWindow to the front of the container has changed the image preview, despite the control's contents not changing. Is there a way to always get the same preview (preferably the one where I see more of the DataGrid)?

Repro Steps for Scenario 2:
1. I open my application and put the DataGrid ToolWindow up front (so the PropertyGrid ToolWindow is behind it).
2. I select an object so both controls display information.
3. I hit Ctrl+Tab to bring up the switcher.
4. I select the PropertyGrid control's ToolWindow under Active Tool Windows and see its image preview. I notice that the right column (where property values are displayed) is on the left hand side of the window preview and the column's width is shrunk. To the right of the column is whitespace, although I can see the border of the ToolWindow in the preview. Additionally, the left hand column, where property names are displayed, is missing.
5. I release Ctrl+Tab so the PropertyGrid ToolWindow moves to the front of the ToolWindow container. Oddly, its left hand column has collapsed so only the right column appears (although its width matches the width of the ToolWindow - there's no whitespace).
6. I hit Ctrl+Tab again and notice that the PropertyGrid ToolWindow's image preview now matches the tool window's appearance (no column shrinking and no additional whitespace).

Thus, it seems that the property grid's column widths are actually being altered and that the image preview is adding additional whitespace. Is there any way to avoid the column resizing when the property grid's ToolWindow is not on top?

(Note that if I repeat steps 1 and 2 above, but simply click on the PropertyGrid ToolWindow's tab to bring it to the front, instead of using Ctrl+Tab, the PropertyGrid columns aren't altered in a way. Thus, it does seem like using Ctrl+Tab is impacting it.)

Thanks very much for your help,

-Craig

[Modified at 06/15/2009 03:48 PM]

Comments (3)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Craig,

Yes samples would help to show these issues. Please email them over.

Our code uses a VisualBrush to try and capture the contents of the window. As far as the differences in appearance, it may have something to do with the control not being laid out properly initially since perhaps it's not visible in the UI yet. Then after it does appear once, it looks good from that point on.


Actipro Software Support

Posted 16 years ago by Craig - Varigence, Inc.
Avatar
I've just emailed a sample over.

Thanks again,

-Craig
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Craig,

We were able to resolve this specific issue. The VisualBrush was giving elements unlimited space to arrange themselves, which was only an issue for elements that were not currently part of the visual tree or previously measured/arranged. But like I said, we were able to fix this.

There is a larger issue with certain controls relating to how WPF loads/unloads controls. The ToolWindow tabs work like the native WPF TabControl, where it switches in the Content of the selected tab. When moving from one tab to another, the previous content is unloaded (for both the ToolWindow tabs and the TabControl). Some controls that are not loaded do not properly update/render, such as the DataGrid control. We're not exactly sure how to work around this (or if it's even possible), but we've made a note to look into this.


Actipro Software Support

The latest build of this product (v24.1.3) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.