feat: clean up warnings.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Metadata;
|
||||
@@ -37,7 +36,7 @@ public class SelectionList: SelectingItemsControl
|
||||
SelectionModeProperty.OverrideMetadata<SelectionList>(
|
||||
new StyledPropertyMetadata<SelectionMode>(
|
||||
defaultValue: SelectionMode.Single,
|
||||
coerce: (o, mode) => SelectionMode.Single)
|
||||
coerce: (_, _) => SelectionMode.Single)
|
||||
);
|
||||
SelectedItemProperty.Changed.AddClassHandler<SelectionList, object?>((list, args) =>
|
||||
list.OnSelectedItemChanged(args));
|
||||
|
||||
@@ -14,9 +14,6 @@ public class SelectionListItem: ContentControl, ISelectable
|
||||
PressedMixin.Attach<SelectionListItem>();
|
||||
FocusableProperty.OverrideDefaultValue<SelectionListItem>(true);
|
||||
}
|
||||
|
||||
private static readonly Point s_invalidPoint = new Point(double.NaN, double.NaN);
|
||||
private Point _pointerDownPoint = s_invalidPoint;
|
||||
|
||||
public static readonly StyledProperty<bool> IsSelectedProperty = SelectingItemsControl.IsSelectedProperty.AddOwner<ListBoxItem>();
|
||||
|
||||
@@ -29,7 +26,7 @@ public class SelectionListItem: ContentControl, ISelectable
|
||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||
{
|
||||
base.OnPointerPressed(e);
|
||||
if (ItemsControl.ItemsControlFromItemContaner(this) is SelectionList list)
|
||||
if (ItemsControl.ItemsControlFromItemContainer(this) is SelectionList list)
|
||||
{
|
||||
int index = list.IndexFromContainer(this);
|
||||
list.SelectByIndex(index);
|
||||
|
||||
Reference in New Issue
Block a user