From 11e64f69d00d84974bb09bef6f921c7eeab7c47e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 24 Jan 2018 18:30:53 +0200 Subject: Added Graphs Drag & Drop to Developer Module. --- .../Views/MainView.xaml | 179 ++++++++++++++++++++- .../Views/MainView.xaml.cs | 27 ++++ 2 files changed, 199 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 7d98fe2d7..40babfc74 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:global="clr-namespace:Tango.MachineStudio.Developer" + xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" @@ -31,6 +32,51 @@ + + + + @@ -291,7 +337,7 @@ - + @@ -331,9 +377,9 @@ - + - + @@ -402,7 +448,7 @@ - + - CAMERAS + + + + + USB CAMERAS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + AVAILABLE GRAPHS + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + DRAG & DROP GRAPHS + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs index 6ebfd9832..9eeff4975 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs @@ -12,6 +12,9 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.DAL.Observables; +using Tango.DragAndDrop; +using Tango.MachineStudio.Developer.ViewModels; namespace Tango.MachineStudio.Developer.Views { @@ -20,9 +23,33 @@ namespace Tango.MachineStudio.Developer.Views /// public partial class MainView : UserControl { + private MainViewVM _vm; + + public DraggingSurface DraggingSurface + { + get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } + set { SetValue(DraggingSurfaceProperty, value); } + } + public static readonly DependencyProperty DraggingSurfaceProperty = + DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(MainView), new PropertyMetadata(null)); + public MainView() { InitializeComponent(); + + DraggingSurface = draggingSurface; + this.Loaded += (x, y) => + { + _vm = DataContext as MainViewVM; + }; + } + + private void OnDropAvailableSensor(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is Sensor) + { + _vm.OnDropAvailableSensor(e.Draggable.DataContext as Sensor); + } } } } -- cgit v1.3.1