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

SplitButton style #3549

Open
jbooth88 opened this issue Apr 29, 2024 · 3 comments
Open

SplitButton style #3549

jbooth88 opened this issue Apr 29, 2024 · 3 comments
Labels

Comments

@jbooth88
Copy link

Bug explanation

Some button properties in the new materialDesign:SplitButton control are unable to be changed without overriding the ButtonStyle.

For example, altering the font size affects the popup, but the left button (PART_LeftButton) is stuck at 14pt.
I don't know if this is a bug or by design.

Version

5.0

@jbooth88 jbooth88 added bug evaluation required Items is pending review or evaluation by the team labels Apr 29, 2024
@nicolaihenriksen nicolaihenriksen removed the evaluation required Items is pending review or evaluation by the team label Apr 30, 2024
@nicolaihenriksen
Copy link
Contributor

@jbooth88 seems like a bug to me. We should probably forward some additional common, non-inheritable, properties (like FontSize) down to the nested button here.

@Keboo
Copy link
Member

Keboo commented May 9, 2024

So right now the ButtonStyle is what is used to configured the internal buttons. If we do template bindings (which I think might be the right answer), then anything with a template binding can't be set via that style.

I am thinking we might want to just obsolete that property and use template bindings for everything as that is a more common use case. Thoughts?

@nicolaihenriksen
Copy link
Contributor

nicolaihenriksen commented May 9, 2024

@Keboo So the SplitButton.ButtonStyle DP, in my mind, is an implementation detail. It is really only public to allow for consumers to copy-paste-modify the style and still have it compile. The same result could have been achieved without a DP, but simply a well-known resource key (this approach is used for the DatePicker; see here), or an attached property.

The DP serves a single purpose: Mapping an MDIX SplitButton style to the corresponding MDIX Button style. E.g.:
MaterialDesignFlatDarkSplitButton -> MaterialDesignFlatDarkButton,
MaterialDesignOutlinedLightSplitButton -> MaterialDesignOutlinedLightButton,
etc.

Thus the DP is used to make the SplitButton have a correct baseline-look, but should still allow for modifications via its properties as any other control. As such, I think it is fair to simply forward the "common properties" through via TemplateBindings just like it is already doing for a number of the properties. "Common properties" probably covers any property that is intended to have a visual (and/or possibly behavioral) effect that is relevant to the SplitButton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants