misc: rename & remove.
This commit is contained in:
@@ -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<double> ValueProperty =
|
||||
AvaloniaProperty.Register<Rating, double>(nameof(Value), defaultBindingMode: BindingMode.TwoWay);
|
||||
|
||||
@@ -26,9 +24,6 @@ public class Rating : TemplatedControl
|
||||
public static readonly StyledProperty<bool> AllowHalfProperty =
|
||||
AvaloniaProperty.Register<Rating, bool>(nameof(AllowHalf));
|
||||
|
||||
public static readonly StyledProperty<bool> AllowFocusProperty =
|
||||
AvaloniaProperty.Register<Rating, bool>(nameof(AllowFocus));
|
||||
|
||||
public static readonly StyledProperty<object> CharacterProperty =
|
||||
AvaloniaProperty.Register<Rating, object>(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<ItemsControl>(PART_ItemsControl);
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
Items.Add(new RatingCharacter
|
||||
|
||||
@@ -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<bool> AllowHalfProperty =
|
||||
Rating.AllowHalfProperty.AddOwner<RatingCharacter>();
|
||||
@@ -71,7 +71,7 @@ public class RatingCharacter : TemplatedControl
|
||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
_icon = e.NameScope.Find<Control>(PART_IconGlyph);
|
||||
_icon = e.NameScope.Find<Border>(PART_IconBorder);
|
||||
}
|
||||
|
||||
protected override void OnPointerEntered(PointerEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user