Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
Window State Issues when Minimize Panel is Set
posted

Hello again! I recently found an issue we're having with the XamDialogWindow where a window doesn't open or doesn't open correctly under certain circumstances. We have a dialog window defined in our XAML the user can close and open again and they can minimize it. We have a stack panel at the bottom that is bound to the dialog window's minimize panel so they minimize at the bottom of the screen instead of the top.

Recently I found out that if the user minimized a dialog window, closes it (which sets the state of the window to hidden), then opens it again (changing the state to normal) one of two things will happen:

- It doesn't appear at all. The control is lost to the user until they restart the program.

- It appears but all the user can see is the header and a sliver of the window content. Resizing the window seems to have no effect. If the user minimizes the window again then restores it the window appears fine although any resizing the user tried is still calculated to the window.

I created a demo project that showcases what I could recreate of these bugs. Here are the steps to recreating the bugs, all from a fresh start:

To recreate the second bug:

1) Minimize window

2) Close window

3) Push "Open Dialog Window" button

Window will appear on the minimize panel with a sliver of the content visible. It can't be resized. You can push the minimize button on the header to make it minimized again, then push the minimize button on that header to restore it to it's normal value.

The first bug is due to an issue where moving the dialog window will affect where it appears once it is opened after taking the above steps. If the user moves the window then does the above steps to create the first bug the window will be offset from the minimize panel by the same amount they panned. You can see this if before doing step 1 above you move the dialog window slightly down and to the right then doing the above steps. The window will appear in its bugged state the same amount below and to the right of the origin of the minimize panel as you moved the window before minimizing it.

So far I haven't been able to find any workaround for this issue besides minimizing and restoring a window that is in the invalid state. It has to be initiated by the user. I have a second button "Attempt Window Fix" that I tried to do that would change the window state to minimized then normal. This throws an Argument Exception "Value does not fall within the expected range" if executed when the window is in its invalid state.

I appreciate any help I can get with this problem.

XamDialogWindow Minimize Test.zip
Parents Reply Children