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

Added a way to use DataTemplate in BadgedControl #3790

Merged

Conversation

timunie
Copy link
Collaborator

@timunie timunie commented May 4, 2020

Describe the changes you have made to improve this project

  • Added a BadgeTemplate and BadgeTemplateSelector to the Badge control
  • Set the MinWidth to be ActualHeight. That way we make sure the Badge shape is correct
  • Set the Badge CornerRadius to the half of ActualHeight. This lets the control look rounded as before, even with bigger content

Unit test
None

Additional context
preview:
image

Closed Issues
#3789

@timunie
Copy link
Collaborator Author

timunie commented May 7, 2020

@batzen I saw that this control is provided in ControlzEx. Should I move the code there?

src/MahApps.Metro/Controls/Badged.cs Outdated Show resolved Hide resolved
@batzen
Copy link
Collaborator

batzen commented May 7, 2020

@timunie that part of ControlzEx is "owned" by @punker76 😉 but i guess it should be moved there, shouldn't it?

@timunie
Copy link
Collaborator Author

timunie commented May 7, 2020

@punker76 /cc @batzen
I moved the Properties to ControlzEx. Never the less we need to adjust the Style and the Converter here.

The build fails due to missing the Properties right now, until ControlzEx is updated I guess.

P.S.: I have no idea what I should do to solve the Codacy issues.

see: ControlzEx/ControlzEx#113

@timunie timunie requested a review from punker76 May 7, 2020 08:55
@punker76 punker76 force-pushed the BadgedControl_BadgeContentTemplate branch from 41a0f3b to c90cabf Compare May 7, 2020 09:19
@punker76 punker76 linked an issue May 9, 2020 that may be closed by this pull request
@punker76 punker76 added this to the 2.0.0 milestone May 9, 2020
Copy link
Member

@punker76 punker76 left a comment

Choose a reason for hiding this comment

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

LGTM

@punker76 punker76 merged commit aa8ba4d into MahApps:develop May 9, 2020
@punker76
Copy link
Member

punker76 commented May 9, 2020

@timunie your changes have been merged, thanks for your contribution 👍

@timunie timunie deleted the BadgedControl_BadgeContentTemplate branch May 10, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

BadgedControl should implement a ContentTemplate
3 participants