Browse Source

Make RoutedEvent nullable in event arguments (#20953)

pull/20879/merge
Julien Lebosquain 4 days ago
committed by GitHub
parent
commit
f16fcabd91
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Avalonia.Base/Input/DragEventArgs.cs
  2. 2
      src/Avalonia.Base/Input/FocusChangedEventArgs.cs
  3. 2
      src/Avalonia.Base/Input/FocusChangingEventArgs.cs
  4. 2
      src/Avalonia.Base/Input/PointerDeltaEventArgs.cs
  5. 4
      src/Avalonia.Base/Input/PointerEventArgs.cs
  6. 2
      src/Avalonia.Base/Input/TappedEventArgs.cs
  7. 2
      src/Avalonia.Controls/NumericUpDown/NumericUpDownValueChangedEventArgs.cs
  8. 2
      src/Avalonia.Controls/Page/DrawerClosingEventArgs.cs
  9. 2
      src/Avalonia.Controls/Page/PageSelectionChangedEventArgs.cs
  10. 2
      src/Avalonia.Controls/ScrollChangedEventArgs.cs
  11. 2
      src/Avalonia.Controls/SelectionChangedEventArgs.cs
  12. 4
      src/Avalonia.Controls/Spinner.cs

2
src/Avalonia.Base/Input/DragEventArgs.cs

@ -27,7 +27,7 @@ namespace Avalonia.Input
[Unstable("This constructor might be removed in 12.0. For unit testing, consider using DragDrop.DoDragDrop or IHeadlessWindow.DragDrop.")]
public DragEventArgs(
RoutedEvent<DragEventArgs> routedEvent,
RoutedEvent<DragEventArgs>? routedEvent,
IDataTransfer dataTransfer,
Interactive target,
Point targetLocation,

2
src/Avalonia.Base/Input/FocusChangedEventArgs.cs

@ -11,7 +11,7 @@ namespace Avalonia.Input
/// Initializes a new instance of <see cref="FocusChangedEventArgs"/>.
/// </summary>
/// <param name="routedEvent">The routed event associated with these event args.</param>
public FocusChangedEventArgs(RoutedEvent routedEvent)
public FocusChangedEventArgs(RoutedEvent? routedEvent)
: base(routedEvent)
{
}

2
src/Avalonia.Base/Input/FocusChangingEventArgs.cs

@ -12,7 +12,7 @@ namespace Avalonia.Input
/// <summary>
/// Provides data for focus changing.
/// </summary>
internal FocusChangingEventArgs(RoutedEvent routedEvent) : base(routedEvent)
public FocusChangingEventArgs(RoutedEvent? routedEvent) : base(routedEvent)
{
}

2
src/Avalonia.Base/Input/PointerDeltaEventArgs.cs

@ -10,7 +10,7 @@ namespace Avalonia.Input
public Vector Delta { get; }
[Unstable("This constructor might be removed in 12.0.")]
public PointerDeltaEventArgs(RoutedEvent routedEvent, object? source,
public PointerDeltaEventArgs(RoutedEvent? routedEvent, object? source,
IPointer pointer, Visual rootVisual, Point rootVisualPosition, ulong timestamp,
PointerPointProperties properties, KeyModifiers modifiers, Vector delta)
: base(routedEvent, source, pointer, rootVisual, rootVisualPosition,

4
src/Avalonia.Base/Input/PointerEventArgs.cs

@ -15,7 +15,7 @@ namespace Avalonia.Input
private readonly Lazy<IReadOnlyList<RawPointerPoint>?>? _previousPoints;
[Unstable("This constructor might be removed in 12.0. For unit testing, consider using IHeadlessWindow mouse methods.")]
public PointerEventArgs(RoutedEvent routedEvent,
public PointerEventArgs(RoutedEvent? routedEvent,
object? source,
IPointer pointer,
Visual? rootVisual, Point rootVisualPosition,
@ -33,7 +33,7 @@ namespace Avalonia.Input
KeyModifiers = modifiers;
}
internal PointerEventArgs(RoutedEvent routedEvent,
internal PointerEventArgs(RoutedEvent? routedEvent,
object? source,
IPointer pointer,
Visual? rootVisual, Point rootVisualPosition,

2
src/Avalonia.Base/Input/TappedEventArgs.cs

@ -6,7 +6,7 @@ namespace Avalonia.Input
{
private readonly PointerEventArgs lastPointerEventArgs;
public TappedEventArgs(RoutedEvent routedEvent, PointerEventArgs lastPointerEventArgs)
public TappedEventArgs(RoutedEvent? routedEvent, PointerEventArgs lastPointerEventArgs)
: base(routedEvent)
{
this.lastPointerEventArgs = lastPointerEventArgs;

2
src/Avalonia.Controls/NumericUpDown/NumericUpDownValueChangedEventArgs.cs

@ -4,7 +4,7 @@ namespace Avalonia.Controls
{
public class NumericUpDownValueChangedEventArgs : RoutedEventArgs
{
public NumericUpDownValueChangedEventArgs(RoutedEvent routedEvent, decimal? oldValue, decimal? newValue) : base(routedEvent)
public NumericUpDownValueChangedEventArgs(RoutedEvent? routedEvent, decimal? oldValue, decimal? newValue) : base(routedEvent)
{
OldValue = oldValue;
NewValue = newValue;

2
src/Avalonia.Controls/Page/DrawerClosingEventArgs.cs

@ -11,7 +11,7 @@ namespace Avalonia.Controls
/// Initializes a new instance of the <see cref="DrawerClosingEventArgs"/> class.
/// </summary>
/// <param name="routedEvent">The routed event associated with these event data.</param>
public DrawerClosingEventArgs(RoutedEvent routedEvent) : base(routedEvent) { }
public DrawerClosingEventArgs(RoutedEvent? routedEvent) : base(routedEvent) { }
/// <summary>
/// Gets or sets a value indicating whether the closing should be cancelled.

2
src/Avalonia.Controls/Page/PageSelectionChangedEventArgs.cs

@ -13,7 +13,7 @@ namespace Avalonia.Controls
/// <param name="routedEvent">The routed event associated with this event args instance.</param>
/// <param name="previousPage">The page that was selected before the change, or <see langword="null"/> if no page was selected.</param>
/// <param name="currentPage">The page that is now selected, or <see langword="null"/> if selection was cleared.</param>
public PageSelectionChangedEventArgs(RoutedEvent routedEvent, Page? previousPage, Page? currentPage)
public PageSelectionChangedEventArgs(RoutedEvent? routedEvent, Page? previousPage, Page? currentPage)
: base(routedEvent)
{
PreviousPage = previousPage;

2
src/Avalonia.Controls/ScrollChangedEventArgs.cs

@ -16,7 +16,7 @@ namespace Avalonia.Controls
}
public ScrollChangedEventArgs(
RoutedEvent routedEvent,
RoutedEvent? routedEvent,
Vector extentDelta,
Vector offsetDelta,
Vector viewportDelta)

2
src/Avalonia.Controls/SelectionChangedEventArgs.cs

@ -15,7 +15,7 @@ namespace Avalonia.Controls
/// <param name="routedEvent">The event being raised.</param>
/// <param name="removedItems">The items removed from the selection.</param>
/// <param name="addedItems">The items added to the selection.</param>
public SelectionChangedEventArgs(RoutedEvent routedEvent, IList removedItems, IList addedItems)
public SelectionChangedEventArgs(RoutedEvent? routedEvent, IList removedItems, IList addedItems)
: base(routedEvent)
{
RemovedItems = removedItems;

4
src/Avalonia.Controls/Spinner.cs

@ -66,7 +66,7 @@ namespace Avalonia.Controls
Direction = direction;
}
public SpinEventArgs(RoutedEvent routedEvent, SpinDirection direction)
public SpinEventArgs(RoutedEvent? routedEvent, SpinDirection direction)
: base(routedEvent)
{
Direction = direction;
@ -78,7 +78,7 @@ namespace Avalonia.Controls
UsingMouseWheel = usingMouseWheel;
}
public SpinEventArgs(RoutedEvent routedEvent, SpinDirection direction, bool usingMouseWheel)
public SpinEventArgs(RoutedEvent? routedEvent, SpinDirection direction, bool usingMouseWheel)
: base(routedEvent)
{
Direction = direction;

Loading…
Cancel
Save