Browse Source

Replaced obsolete PointerEventArgs.Device usages.

pull/3524/head
José Pedro 6 years ago
parent
commit
12e483acd1
No known key found for this signature in database GPG Key ID: B8247B9301707B83
  1. 4
      src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs
  2. 12
      src/Avalonia.Controls/Calendar/CalendarItem.cs

4
src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs

@ -326,7 +326,7 @@ namespace Avalonia.Controls
if (OwningGrid != null && OwningGrid.ColumnHeaders != null) if (OwningGrid != null && OwningGrid.ColumnHeaders != null)
{ {
args.Device.Capture(this); args.Pointer.Capture(this);
_dragMode = DragMode.MouseDown; _dragMode = DragMode.MouseDown;
_frozenColumnsWidth = OwningGrid.ColumnsInternal.GetVisibleFrozenEdgedColumnsWidth(); _frozenColumnsWidth = OwningGrid.ColumnsInternal.GetVisibleFrozenEdgedColumnsWidth();
@ -391,7 +391,7 @@ namespace Avalonia.Controls
SetDragCursor(mousePosition); SetDragCursor(mousePosition);
// Variables that track drag mode states get reset in DataGridColumnHeader_LostMouseCapture // Variables that track drag mode states get reset in DataGridColumnHeader_LostMouseCapture
args.Device.Capture(null); args.Pointer.Capture(null);
OnLostMouseCapture(); OnLostMouseCapture();
_dragMode = DragMode.None; _dragMode = DragMode.None;
handled = true; handled = true;

12
src/Avalonia.Controls/Calendar/CalendarItem.cs

@ -943,8 +943,8 @@ namespace Avalonia.Controls.Primitives
{ {
CalendarDayButton b = (CalendarDayButton)sender; CalendarDayButton b = (CalendarDayButton)sender;
// The button is in Pressed state. Change the state to normal. // The button is in Pressed state. Change the state to normal.
if (e.Device.Captured == b) if (e.Pointer.Captured == b)
e.Device.Capture(null); e.Pointer.Capture(null);
_lastCalendarDayButton = b; _lastCalendarDayButton = b;
} }
} }
@ -1213,8 +1213,8 @@ namespace Avalonia.Controls.Primitives
{ {
CalendarButton b = (CalendarButton)sender; CalendarButton b = (CalendarButton)sender;
// The button is in Pressed state. Change the state to normal. // The button is in Pressed state. Change the state to normal.
if (e.Device.Captured == b) if (e.Pointer.Captured == b)
e.Device.Capture(null); e.Pointer.Capture(null);
//b.ReleaseMouseCapture(); //b.ReleaseMouseCapture();
_lastCalendarButton = b; _lastCalendarButton = b;
@ -1224,7 +1224,7 @@ namespace Avalonia.Controls.Primitives
{ {
if (_lastCalendarDayButton != null) if (_lastCalendarDayButton != null)
{ {
e.Device.Capture(_lastCalendarDayButton); e.Pointer.Capture(_lastCalendarDayButton);
} }
} }
@ -1232,7 +1232,7 @@ namespace Avalonia.Controls.Primitives
{ {
if (_lastCalendarButton != null) if (_lastCalendarButton != null)
{ {
e.Device.Capture(_lastCalendarButton); e.Pointer.Capture(_lastCalendarButton);
} }
} }

Loading…
Cancel
Save