feat: fix various badge layout issues.

This commit is contained in:
Dong Bin
2025-04-15 22:10:44 +08:00
parent a920effe26
commit 9e3f22c557
4 changed files with 39 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ public class Badge : HeaderedContentControl
static Badge()
{
HeaderProperty.Changed.AddClassHandler<Badge>((badge, _) => badge.UpdateBadgePosition());
CornerPositionProperty.Changed.AddClassHandler<Badge>((badge, _) => badge.UpdateBadgePosition());
DotProperty.Changed.AddClassHandler<Badge>((badge, _) => badge.UpdateBadgePosition());
}
@@ -83,8 +84,9 @@ public class Badge : HeaderedContentControl
protected override Size ArrangeOverride(Size finalSize)
{
var size = base.ArrangeOverride(finalSize);
UpdateBadgePosition();
return base.ArrangeOverride(finalSize);
return size;
}
private void UpdateBadgePosition()