-
Notifications
You must be signed in to change notification settings - Fork 463
Added CornerRadius bindable property #1732
Added CornerRadius bindable property #1732
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include a sample (for example a Slider to change the CornerRadius) here https://github.com/xamarin/XamarinCommunityToolkit/blob/main/samples/XCT.Sample/Pages/Views/BadgeViewPage.xaml?
/// <summary> | ||
/// Backing BindableProperty for the <see cref="CornerRadius"/> property. | ||
/// </summary> | ||
public static readonly BindableProperty CornerRadiusProperty = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we create a constant like https://github.com/xamarin/Xamarin.Forms/blob/caab66bcf9614aca0c0805d560a34e176d196e17/Xamarin.Forms.Core/BorderElement.cs#L7?, why different values by platform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was initialized like this before my change.
Setting those default values will prevent to modify the badgeview appearance when people will update the nuget package.
I will add a sample OK, thanks for your feedback
Thanks for your very first contribution to GitHub @espritm ! We're honored that you chose the Toolkit to be the project to contribute to! |
@@ -6,6 +6,7 @@ namespace Xamarin.CommunityToolkit.Sample.ViewModels.Views | |||
public class BadgeViewViewModel : BaseViewModel | |||
{ | |||
int counter; | |||
float cornerRadius; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using double
since it's the type used by Xamarin.Forms as you can see here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... We missed that on the first Code Review, we can change it on the Badge
control and release this one on v2.0 as a breaking change... Or we can leave at it's and change it on MCT. Both work for me, what do you think?
Never mind I saw that Frame.CornerRadius
is float, so XF also didn't care about it.
Hi, |
@AlleSchonWeg what version of the toolkit are you using? If you believe there is an issue can you open a bug report using the template please? |
@bijington, |
@AlleSchonWeg please open a bug, following the template, with a small sample project that reproduce your issue |
I don't see this fixed either. Still displaying as oval using v2.0.4. I cant make the badge view round but would love to know how. using this XAML: <Grid RowDefinitions="auto,auto">
<xct:BadgeView
Grid.Row="0"
BackgroundColor="Red"
FontAttributes="Bold"
FontSize="Small"
Text="1"
TextColor="White">
<Image>
<Image.Source>
<FontImageSource
FontFamily="MaterialDesignIcons"
Glyph="{x:Static fonts:MaterialDesignIcons.TextBoxMultiple}"
Size="{StaticResource SmallFontImageSize}"
Color="{AppThemeBinding Light={StaticResource LightTextColor},
Dark={StaticResource DarkTextColor}}" />
</Image.Source>
</Image>
</xct:BadgeView>
<Label
Grid.Row="1"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Style="{StaticResource LabelSmallHeaderStyle}"
Text="Surveys"
TextColor="{AppThemeBinding Light={StaticResource LightTextColor},
Dark={StaticResource DarkTextColor}}" />
</Grid> |
Description of Bug
Adding
BadgeView.CornerRadius
propertyIssues Fixed
Behavioral Changes
PR Checklist
approved