fix: fix AllowHalf initialization.
This commit is contained in:
@@ -179,16 +179,13 @@ public class Rating : TemplatedControl
|
||||
Items.Add(new RatingCharacter());
|
||||
}
|
||||
|
||||
foreach (var item in Items)
|
||||
{
|
||||
item.AllowHalf = AllowHalf;
|
||||
}
|
||||
SetCurrentValue(ValueProperty, DefaultValue);
|
||||
}
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs e)
|
||||
{
|
||||
base.OnLoaded(e);
|
||||
UpdateItemsByValue(Value);
|
||||
AdjustWidth(Value);
|
||||
}
|
||||
|
||||
public void Preview(RatingCharacter o)
|
||||
{
|
||||
var index = Items.IndexOf(o);
|
||||
|
||||
@@ -17,9 +17,7 @@ public class RatingCharacter : TemplatedControl
|
||||
|
||||
private Control? _icon;
|
||||
|
||||
public static readonly StyledProperty<bool> AllowHalfProperty = AvaloniaProperty.Register<RatingCharacter, bool>(
|
||||
nameof(AllowHalf));
|
||||
|
||||
public static readonly StyledProperty<bool> AllowHalfProperty = Rating.AllowHalfProperty.AddOwner<RatingCharacter>();
|
||||
|
||||
public bool AllowHalf
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user