-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dragdrop): Implement UIElement.CanDrag and AllowDrop
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Windows.UI.Xaml | ||
{ | ||
partial class UIElement | ||
{ | ||
#region CanDrag (DP) | ||
public static DependencyProperty CanDragProperty { get; } = DependencyProperty.Register( | ||
nameof(CanDrag), | ||
typeof(bool), | ||
typeof(UIElement), | ||
new FrameworkPropertyMetadata(default(bool))); | ||
|
||
public bool CanDrag | ||
{ | ||
get => (bool)GetValue(AllowDropProperty); | ||
set => SetValue(AllowDropProperty, value); | ||
} | ||
#endregion | ||
|
||
#region AllowDrop (DP) | ||
public static DependencyProperty AllowDropProperty { get; } = DependencyProperty.Register( | ||
nameof(AllowDrop), | ||
typeof(bool), | ||
typeof(UIElement), | ||
new FrameworkPropertyMetadata(default(bool))); | ||
|
||
public bool AllowDrop | ||
{ | ||
get => (bool)GetValue(CanDragProperty); | ||
set => SetValue(CanDragProperty, value); | ||
} | ||
#endregion | ||
} | ||
} |