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]
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]