feat: clean up warnings.

This commit is contained in:
rabbitism
2024-07-30 18:33:30 +08:00
parent e1f91f612b
commit 15fb5a2d1b
167 changed files with 473 additions and 825 deletions

View File

@@ -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));

View File

@@ -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);