From c9d3c1a7408f6f7a4814c1a8f5cf58a2d13e1694 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 3 Jul 2018 12:03:55 +0300 Subject: Machine Studio. Implemented upload hardware configuration from connected machine view. Implemented process parameters dragging through developer module settings :/ --- .../Tango.DragAndDrop/DragAndDropContainer.cs | 44 ++++++++++++++++++++++ .../Tango.DragAndDrop/DragAndDropService.cs | 4 +- .../Tango.DragAndDrop/Tango.DragAndDrop.csproj | 5 +-- 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 Software/Visual_Studio/Tango.DragAndDrop/DragAndDropContainer.cs (limited to 'Software/Visual_Studio/Tango.DragAndDrop') diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropContainer.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropContainer.cs new file mode 100644 index 000000000..043613308 --- /dev/null +++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropContainer.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Markup; + +namespace Tango.DragAndDrop +{ + [ContentProperty(nameof(InnerContent))] + public class DragAndDropContainer : ContentControl + { + public DragAndDropContainer() + { + Grid g = new Grid(); + Content = g; + + ContentControl control = new ContentControl(); + control.Bind(ContentControl.ContentProperty, this, InnerContentProperty, System.Windows.Data.BindingMode.OneWay); + g.Children.Add(control); + + DraggingSurface = new DraggingSurface(); + g.Children.Add(DraggingSurface); + } + + public DraggingSurface DraggingSurface + { + get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } + private set { SetValue(DraggingSurfaceProperty, value); } + } + public static readonly DependencyProperty DraggingSurfaceProperty = + DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(DragAndDropContainer), new PropertyMetadata(null)); + + public Object InnerContent + { + get { return (Object)GetValue(InnerContentProperty); } + set { SetValue(InnerContentProperty, value); } + } + public static readonly DependencyProperty InnerContentProperty = + DependencyProperty.Register("InnerContent", typeof(Object), typeof(DragAndDropContainer), new PropertyMetadata(null)); + } +} diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs index 445cc3924..26a89911e 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs +++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs @@ -12,7 +12,7 @@ using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Threading; using Tango.Core.EventArguments; -using Tango.SharedUI.Helpers; + namespace Tango.DragAndDrop { @@ -621,7 +621,7 @@ namespace Tango.DragAndDrop { if (_currentDragedElement != null) { - BitmapSource source = UIHelper.TakeSnapshot(_currentDragedElement); + BitmapSource source = _currentDragedElement.TakeSnapshot(); _dragBorder = new Border(); var surface = GetDraggingSurface(_currentDragedElement); diff --git a/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj b/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj index 8d267b703..1cebe0037 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj +++ b/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj @@ -67,6 +67,7 @@ Core.cs + @@ -103,10 +104,6 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core - - {8491d07b-c1f6-4b62-a412-41b9fd2d6538} - Tango.SharedUI -