aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.DragAndDrop
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-27 14:18:38 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-27 14:18:38 +0300
commit0a7cebf17c66bb54e826d2b904d89c73e1c9a33b (patch)
treed72a7b3eb06162cf8f0119c09652d9d739916f9d /Software/Visual_Studio/Tango.DragAndDrop
parent2b9532cf665d8c8e53ea9c8908ae504963e86beb (diff)
downloadTango-0a7cebf17c66bb54e826d2b904d89c73e1c9a33b.tar.gz
Tango-0a7cebf17c66bb54e826d2b904d89c73e1c9a33b.zip
Working on PPC segments drag and drop.
Diffstat (limited to 'Software/Visual_Studio/Tango.DragAndDrop')
-rw-r--r--Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs
index 1ba7907f9..445cc3924 100644
--- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs
+++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs
@@ -102,6 +102,37 @@ namespace Tango.DragAndDrop
#endregion
+ #region DropCommand
+
+ /// <summary>
+ /// Determines whether an element is DropCommand by the drag and drop service.
+ /// </summary>
+ public static readonly DependencyProperty DropCommandProperty =
+ DependencyProperty.RegisterAttached("DropCommand",
+ typeof(ICommand), typeof(DragAndDropService),
+ new FrameworkPropertyMetadata(null));
+ /// <summary>
+ /// Sets the DropCommand attached property.
+ /// </summary>
+ /// <param name="element">The element.</param>
+ /// <param name="value">if set to <c>true</c> [value].</param>
+ public static void SetDropCommand(FrameworkElement element, ICommand value)
+ {
+ element.SetValue(DropCommandProperty, value);
+ }
+
+ /// <summary>
+ /// Gets the DropCommand attached property.
+ /// </summary>
+ /// <param name="element">The element.</param>
+ /// <returns></returns>
+ public static ICommand GetDropCommand(FrameworkElement element)
+ {
+ return (ICommand)element.GetValue(DropCommandProperty);
+ }
+
+ #endregion
+
#region Draggable
/// <summary>
@@ -672,6 +703,13 @@ namespace Tango.DragAndDrop
if (_currentDropElement != null && _currentDragedElement != null)
{
_currentDropElement.RaiseEvent(new DropEventArgs(DropEvent, _currentDragedElement, _currentDropElement, _mouseDownLocation));
+
+ var command = GetDropCommand(_currentDropElement);
+ if (command != null)
+ {
+ command.Execute(new DropEventArgs(DropEvent, _currentDragedElement, _currentDropElement, _mouseDownLocation));
+ }
+
_currentDragedElement = null;
_currentDropElement = null;
}