-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dragdrop): Import the ListView D&D event from generated code
- Loading branch information
Showing
6 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Uno.UI/UI/Xaml/Controls/ListViewBase/DragItemsCompletedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections.Generic; | ||
using Windows.ApplicationModel.DataTransfer; | ||
|
||
#nullable enable | ||
|
||
namespace Windows.UI.Xaml.Controls | ||
{ | ||
public partial class DragItemsCompletedEventArgs | ||
{ | ||
internal DragItemsCompletedEventArgs(DropCompletedEventArgs inner, IReadOnlyList<object> items) | ||
{ | ||
DropResult = inner.DropResult; | ||
Items = items; | ||
} | ||
|
||
public DataPackageOperation DropResult { get; } | ||
public IReadOnlyList<object> Items { get; } | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/Uno.UI/UI/Xaml/Controls/ListViewBase/DragItemsStartingEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#nullable enable | ||
|
||
using System.Collections.Generic; | ||
using Windows.ApplicationModel.DataTransfer; | ||
|
||
namespace Windows.UI.Xaml.Controls | ||
{ | ||
public partial class DragItemsStartingEventArgs | ||
{ | ||
private readonly DragStartingEventArgs? _inner; | ||
|
||
public DragItemsStartingEventArgs() // Part of the public API. DO NOT USE internaly | ||
{ | ||
Data = new DataPackage(); | ||
Items = new List<object>(); | ||
} | ||
|
||
internal DragItemsStartingEventArgs(DragStartingEventArgs inner, IList<object> items) | ||
{ | ||
_inner = inner; | ||
|
||
Data = _inner.Data; | ||
Items = items; | ||
} | ||
|
||
public bool Cancel | ||
{ | ||
get => _inner?.Cancel ?? false; | ||
set | ||
{ | ||
if (_inner is {}) | ||
{ | ||
_inner.Cancel = value; | ||
} | ||
} | ||
} | ||
|
||
public DataPackage Data { get; } | ||
public IList<object> Items { get; } | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/Uno.UI/UI/Xaml/Controls/ListViewBase/DragItemsStartingEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
namespace Windows.UI.Xaml.Controls | ||
{ | ||
public delegate void DragItemsStartingEventHandler(object sender, DragItemsStartingEventArgs e); | ||
} |