feat: add property Size.
This commit is contained in:
@@ -38,6 +38,9 @@ public class Rating : TemplatedControl
|
||||
public static readonly StyledProperty<double> DefaultValueProperty =
|
||||
AvaloniaProperty.Register<Rating, double>(nameof(DefaultValue));
|
||||
|
||||
public static readonly StyledProperty<double> SizeProperty =
|
||||
AvaloniaProperty.Register<RatingCharacter, double>(nameof(Size));
|
||||
|
||||
public static readonly StyledProperty<IDataTemplate?> ItemTemplateProperty =
|
||||
AvaloniaProperty.Register<Rating, IDataTemplate?>(nameof(ItemTemplate));
|
||||
|
||||
@@ -83,6 +86,12 @@ public class Rating : TemplatedControl
|
||||
set => SetValue(DefaultValueProperty, value);
|
||||
}
|
||||
|
||||
public double Size
|
||||
{
|
||||
get => GetValue(SizeProperty);
|
||||
set => SetValue(SizeProperty, value);
|
||||
}
|
||||
|
||||
public IDataTemplate? ItemTemplate
|
||||
{
|
||||
get => GetValue(ItemTemplateProperty);
|
||||
@@ -137,7 +146,8 @@ public class Rating : TemplatedControl
|
||||
Items.Add(new RatingCharacter
|
||||
{
|
||||
Character = Character,
|
||||
AllowHalf = AllowHalf
|
||||
AllowHalf = AllowHalf,
|
||||
Size = Size,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -174,7 +184,8 @@ public class Rating : TemplatedControl
|
||||
Items.Add(new RatingCharacter
|
||||
{
|
||||
Character = Character,
|
||||
AllowHalf = AllowHalf
|
||||
AllowHalf = AllowHalf,
|
||||
Size = Size,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user