diff --git a/demo/Ursa.Demo/Pages/RatingDemo.axaml b/demo/Ursa.Demo/Pages/RatingDemo.axaml index 770b251..89ab51f 100644 --- a/demo/Ursa.Demo/Pages/RatingDemo.axaml +++ b/demo/Ursa.Demo/Pages/RatingDemo.axaml @@ -22,7 +22,6 @@ - - Tooltips { get; set; } = ["1", "2", "3", "4", "5"]; } \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/Rating.axaml b/src/Ursa.Themes.Semi/Controls/Rating.axaml index 40cdf56..6a91411 100644 --- a/src/Ursa.Themes.Semi/Controls/Rating.axaml +++ b/src/Ursa.Themes.Semi/Controls/Rating.axaml @@ -17,7 +17,7 @@ Stretch="Uniform" Data="{TemplateBinding Character}" Fill="{TemplateBinding Background}" /> - - diff --git a/src/Ursa/Controls/Rating/Rating.cs b/src/Ursa/Controls/Rating/Rating.cs index 494ab10..f294c94 100644 --- a/src/Ursa/Controls/Rating/Rating.cs +++ b/src/Ursa/Controls/Rating/Rating.cs @@ -15,8 +15,6 @@ public class Rating : TemplatedControl public const string PART_ItemsControl = "PART_ItemsControl"; protected const string PC_Selected = ":selected"; - private ItemsControl? _itemsControl; - public static readonly StyledProperty ValueProperty = AvaloniaProperty.Register(nameof(Value), defaultBindingMode: BindingMode.TwoWay); @@ -26,9 +24,6 @@ public class Rating : TemplatedControl public static readonly StyledProperty AllowHalfProperty = AvaloniaProperty.Register(nameof(AllowHalf)); - public static readonly StyledProperty AllowFocusProperty = - AvaloniaProperty.Register(nameof(AllowFocus)); - public static readonly StyledProperty CharacterProperty = AvaloniaProperty.Register(nameof(Character)); @@ -62,12 +57,6 @@ public class Rating : TemplatedControl set => SetValue(AllowHalfProperty, value); } - public bool AllowFocus - { - get => GetValue(AllowFocusProperty); - set => SetValue(AllowFocusProperty, value); - } - public object Character { get => GetValue(CharacterProperty); @@ -177,8 +166,6 @@ public class Rating : TemplatedControl protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); - - _itemsControl = e.NameScope.Find(PART_ItemsControl); for (var i = 0; i < Count; i++) { Items.Add(new RatingCharacter diff --git a/src/Ursa/Controls/Rating/RatingCharacter.cs b/src/Ursa/Controls/Rating/RatingCharacter.cs index 08f5034..c3623cf 100644 --- a/src/Ursa/Controls/Rating/RatingCharacter.cs +++ b/src/Ursa/Controls/Rating/RatingCharacter.cs @@ -9,13 +9,13 @@ using Avalonia.LogicalTree; namespace Ursa.Controls; [PseudoClasses(PC_Selected)] -[TemplatePart(PART_IconGlyph, typeof(Control))] +[TemplatePart(PART_IconBorder, typeof(Border))] public class RatingCharacter : TemplatedControl { - public const string PART_IconGlyph = "PART_IconGlyph"; + public const string PART_IconBorder = "PART_IconBorder"; protected const string PC_Selected = ":selected"; - private Control? _icon; + private Border? _icon; public static readonly StyledProperty AllowHalfProperty = Rating.AllowHalfProperty.AddOwner(); @@ -71,7 +71,7 @@ public class RatingCharacter : TemplatedControl protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); - _icon = e.NameScope.Find(PART_IconGlyph); + _icon = e.NameScope.Find(PART_IconBorder); } protected override void OnPointerEntered(PointerEventArgs e)