Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DialogHost.DialogCardStyle DP to allow control from calling code #3459

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nicolaihenriksen
Copy link
Contributor

@nicolaihenriksen nicolaihenriksen commented Feb 12, 2024

Fixes #3430

UPDATE

The outstanding issue we have with this PR is the fact that calling code can effectively set a (card) style, but several properties from that style will be ignored because they are "passed-in/hardcoded" in the PART_PopupContentElement element in the DialogHost style.


This PR allows the calling code to control the style of the nested Card in the DialogHost. Default Background property is now set directly on the card, and the trigger to fall back to the default background is moved to the ControlTemplate.Triggers collection.

@Keboo I started on writing some UI test to verify this gets passed down, but I hit a roadblock around getting the Style (or perhaps just the name of the style) out of an IVisualElement, any hints you can provide?

IVisualElement<DialogHost> dialogHost = await grid.GetElement<DialogHost>("DialogHost");
IVisualElement<Card> nestedCard = await dialogHost.GetElement<Card>("PART_PopupContentElement");

// TODO: Assert the style on the nested card matches what is set in DialogHost.DialogCardStyle
Copy link
Contributor Author

@nicolaihenriksen nicolaihenriksen Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Keboo this is where I hit a road block. Any help would be appreciated 🙏

@Keboo Keboo added this to the 5.1.0 milestone Mar 7, 2024
Rather than asserting on the style, it asserts on a set value from the style.
@Keboo Keboo modified the milestones: 5.1.0, 5.2.0 Jun 13, 2024
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.

DialogHost Style
2 participants