Popup resize behavior (bug)?

Navigation for WPF Forum

Posted 11 years ago by Kollen Glynn
Version: 3.5.0428
Avatar
We have noticed in testing that the popup can be resized horizontally to the maximum width of the main window but this also resizes the NavigationBar when it's not minimized. The problem is the NavigationBar is contained within a grid column that has a MaxWidth set and that resizing the popup essentially gets around this MaxWidth setting once the NavigationBar is un-minimized.

In our case the grid contains three columns: NavigationBar, Splitter, ListView.

Is this a bug in the NavigationBar or something we're not doing correctly?

Ideally we'd like the same behavior as Outlook: for the popup to respect the MaxMidth on the column like resizing the Wunderbar width with the splitter would.

Kollen

Comments (6)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Right now if you set the same MaxWidth on the NavigationBar, you will see it perform correctly. I believe this is in the NavigationBarIntro demo too if you need an example.

We've looked into this and the problem is that the Grid always passes double.PositiveInfinity to our NavigationBar.MeasureOverride. So there isn't a way for us to know that there is a MaxWidth restriction other than if you apply it directly on the NavigationBar as mentioned above. Then oddly enough if you grab a splitter from the grid and drag it a pixel, NavigationBar.MeasureOverride does get a restricted non-infinite value from the Grid's MaxWidth. So this would seem to be a bug in the Grid code to me.


Actipro Software Support

Posted 11 years ago by Kollen Glynn
Avatar
Thanks that mostly works. The only thing that doesn't is that it doesn't restrict the resizing of the popup. If you un-minimize, minmize then show the popup again it is set to MaxWidth but the initial resizing is not restricted.
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you set the MaxWidth on the root child element of the pane too, that will prevent the popup from resizing beyond that.


Actipro Software Support

Posted 11 years ago by Kollen Glynn
Avatar
Thanks. I would expect this to just work if the MaxWidth is set on the main control.
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
No problem, glad to help.

Well for the original thing you posted about, I would expect Grid to pass us down the column's MaxWidth but it doesn't. That SHOULD have updated the NavigationBar's MaxWidth. But since it doesn't do that, it requires explicit setting.

The popup is a different story though because it is based on the selected pane's content, not the NavigationBar. There may be times where you want the content in the popup to be able to expand to a large size while when not minimized it can't. Or in other scenarios maybe you want some panes' content to be able to be large while the rest can't.

In your case you do want them both to be restricted, thus the need to put the MaxWidth on the pane's root content element.


Actipro Software Support

Posted 11 years ago by Kollen Glynn
Avatar
Please contact me offline and I'll get a bug opened on the WPF team for the Grid.
The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.