Skip to content

Add support for various properties to PopupBox#4011

Open
corvinsz wants to merge 2 commits intoMaterialDesignInXAML:masterfrom
corvinsz:fix4010
Open

Add support for various properties to PopupBox#4011
corvinsz wants to merge 2 commits intoMaterialDesignInXAML:masterfrom
corvinsz:fix4010

Conversation

@corvinsz
Copy link
Member

fixes #4010

fixes everything mentioned in the linked issue.
The changes are largely based on how it's done in the other button styles.

popupBoxPost.mp4

…ss and ButtonAssist.CornerRadius and hover-effect to PopupBox
@corvinsz
Copy link
Member Author

The test PopupBox_WithContentTemplateSelector_ChangesContent is failing even on the main branch, so I doubt it has anything to do with the changes I have done?

For some reason the background color is null.
Could this possibly be a XAMLTest issue?
image

@nicolaihenriksen
Copy link
Contributor

The test PopupBox_WithContentTemplateSelector_ChangesContent is failing even on the main branch

@corvinsz I doubt that it fails on the main branch, because that would fail the pipeline. However, note that the await Wait.For() is there for resilience (indicating that the assertion may fail a number of times before passing). So simply stepping through with the debugger attached, could give you some wrong results. In this particular case, it is probably also very much timing related as I assume the await button.LeftClick() is intended to open the Popup which requires a little time/animation.

Try to set a break point on the await Wait.For() line and ensure the "attach debugger to remote process" is appropriately set allowing you to interact with the test window. Then use Snoop to dig out the actual value when the popup is open.

@nicolaihenriksen
Copy link
Contributor

@corvinsz Looking at your changes, I believe the issue is that the test simply looks up a border inside the Popup using this code:

var border = await popupBox.GetElement<Border>();

And since you have introduced a Border element further up in the visual tree (in the control template), it now grabs the wrong border. Perhaps the best approach is to appropriately name the Border in PopupBoxWithTemplateSelector and then look it up by name instead of just grabbing the first border it finds.

because the PopupBox now contains a nested border in it's template, the test was broken because it was getting the border in the template instead of the call-site defined content, which is wrong. getting the border by x:Name disambiguates them
@corvinsz
Copy link
Member Author

@nicolaihenriksen I see, thank you for the detailed explanation. I was not aware of the fact that you can't easily debug the await Wait.For().
I went with your proposed solution to just reference the Border by name.

@Keboo Keboo requested review from Keboo and removed request for Keboo February 24, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visual PopupBox enhancement

2 participants