Skip to content

Commit

Permalink
feat(dragdrop): Import the ListView D&D event from generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Dec 1, 2020
1 parent 1114c7b commit c43f6d6
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Xaml.Controls
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented]
#endif
public partial class DragItemsCompletedEventArgs
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::Windows.ApplicationModel.DataTransfer.DataPackageOperation DropResult
{
Expand All @@ -17,7 +17,7 @@ public partial class DragItemsCompletedEventArgs
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::System.Collections.Generic.IReadOnlyList<object> Items
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Xaml.Controls
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented]
#endif
public partial class DragItemsStartingEventArgs
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public bool Cancel
{
Expand All @@ -21,7 +21,7 @@ public bool Cancel
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::Windows.ApplicationModel.DataTransfer.DataPackage Data
{
Expand All @@ -31,7 +31,7 @@ public bool Cancel
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::System.Collections.Generic.IList<object> Items
{
Expand All @@ -41,7 +41,7 @@ public bool Cancel
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public DragItemsStartingEventArgs()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Xaml.Controls
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
public delegate void DragItemsStartingEventHandler(object @sender, global::Windows.UI.Xaml.Controls.DragItemsStartingEventArgs @e);
#endif
}
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; }
}
}
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; }
}
}
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);
}

0 comments on commit c43f6d6

Please sign in to comment.