From cc3480d4aac4175b1072060dd2d6d398d3451ae8 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 30 Dec 2018 01:27:53 +0200 Subject: Working on dispenserssssssss --- .../Views/ConfigurationView.xaml | 718 ++++++++++++++++++ .../Views/ConfigurationView.xaml.cs | 172 +++++ .../Views/MachineDetailsView.xaml | 44 ++ .../Views/MachineDetailsView.xaml.cs | 28 + .../Views/MachineView.xaml | 2 +- .../Views/MachinesView.xaml | 73 ++ .../Views/MachinesView.xaml.cs | 28 + .../Views/MainView.xaml | 811 +-------------------- .../Views/MainView.xaml.cs | 148 +--- 9 files changed, 1078 insertions(+), 946 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml new file mode 100644 index 000000000..a96cd4685 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml @@ -0,0 +1,718 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hardware Version + + + + + + Add IDS + + + + + + Remove IDS + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NO IDS PACKS + + + + + + + + + + + + + + + + + + + + + Touch Panel + + + + + + Embedded Firmware + + + + + + Dispensers + + + + + + Mid Tanks + + + + + + Cartridges + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IDS PACKS + + + + + + + PACK: # + + + + + Dispenser: + + + + Mid Tank: + + + + Cartridge: + + + + Liquid: + + + + Formula: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + v + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + v + + + + + + + + + + + + + + + + + + + + + + + v + + + + + + + + + + + + + + + + + + + + + + + v + + + + + + + + + + + + + + + + + + + + + + + v + + + + + + + + + + + + + + + + + + + + + + + v + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml.cs new file mode 100644 index 000000000..941a2792d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.BL.Entities; +using Tango.DragAndDrop; +using Tango.MachineStudio.MachineDesigner.ViewModels; + +namespace Tango.MachineStudio.MachineDesigner.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class ConfigurationView : UserControl + { + private MainViewVM _vm; + private Rectangle _highlightRect; + private bool _highlightShown; + private DoubleAnimation _highlightAnimation; + + public ColumnDefinition PanelColumnDefinition { get; set; } + + public ConfigurationView() + { + InitializeComponent(); + + PanelColumnDefinition = panelColumnDefinition; + + DraggingSurface = dragSufrace; + this.Loaded += (x, y) => + { + _vm = DataContext as MainViewVM; + }; + + DragAndDropService.DragStarted += DragAndDropService_DragStarted; + DragAndDropService.DragEnded += DragAndDropService_DragEnded; + + _highlightRect = new Rectangle(); + _highlightRect.IsHitTestVisible = false; + _highlightRect.Stroke = Application.Current.Resources["AccentColorBrush"] as Brush; + _highlightRect.StrokeThickness = 2; + _highlightRect.StrokeDashArray = new DoubleCollection(new double[] { 3, 3, 3, 3 }); + } + + private void DragAndDropService_DragEnded(object sender, FrameworkElement e) + { + canvas.Children.Remove(_highlightRect); + _highlightShown = false; + _highlightRect.BeginAnimation(Rectangle.OpacityProperty, null); + } + + private void DragAndDropService_DragStarted(object sender, FrameworkElement e) + { + if (e.DataContext is HardwareVersion) + { + SetHighlightRegion(hardwareGrid); + } + else if (e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion || e.DataContext is ApplicationFirmwareVersion) + { + SetHighlightRegion(gridTablet); + } + else if (e.DataContext is EmbeddedFirmwareVersion) + { + SetHighlightRegion(gridEmbedded); + } + else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType || e.DataContext is IdsPackFormula) + { + SetHighlightRegion(gridIds); + } + } + + 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)); + + private void OnDropOnIdsPack(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is Dispenser) + { + _vm.DropDispenser(e.Draggable.DataContext as Dispenser, e.Droppable.DataContext as IdsPack); + } + else if (e.Draggable.DataContext is LiquidType) + { + _vm.DropLiquidType(e.Draggable.DataContext as LiquidType, e.Droppable.DataContext as IdsPack); + } + else if (e.Draggable.DataContext is CartridgeType) + { + _vm.DropCartridgeType(e.Draggable.DataContext as CartridgeType, e.Droppable.DataContext as IdsPack); + } + else if (e.Draggable.DataContext is MidTankType) + { + _vm.DropMidTankType(e.Draggable.DataContext as MidTankType, e.Droppable.DataContext as IdsPack); + } + else if (e.Draggable.DataContext is IdsPackFormula) + { + _vm.DropIdsFormula(e.Draggable.DataContext as IdsPackFormula, e.Droppable.DataContext as IdsPack); + } + else if (e.Draggable.DataContext is IdsPack) + { + _vm.DropIdsPack(e.Draggable.DataContext as IdsPack, e.Droppable.DataContext as IdsPack); + } + } + + private void OnTabletDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is ApplicationDisplayPanelVersion) + { + _vm.DropTouchPanel(e.Draggable.DataContext as ApplicationDisplayPanelVersion); + } + else if (e.Draggable.DataContext is ApplicationOsVersion) + { + _vm.DropApplicationOsVersion(e.Draggable.DataContext as ApplicationOsVersion); + } + else if (e.Draggable.DataContext is ApplicationFirmwareVersion) + { + _vm.DropApplicationFirmwareVersion(e.Draggable.DataContext as ApplicationFirmwareVersion); + } + } + + private void OnEmbeddedDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is EmbeddedFirmwareVersion) + { + _vm.DropEmbeddedFirmware(e.Draggable.DataContext as EmbeddedFirmwareVersion); + } + } + + private void MachineDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is HardwareVersion) + { + _vm.DropHardwareVersion(e.Draggable.DataContext as HardwareVersion); + } + } + + private void SetHighlightRegion(FrameworkElement element) + { + if (!_highlightShown) + { + _highlightRect.Width = element.Width; + _highlightRect.Height = element.Height; + Canvas.SetLeft(_highlightRect, Canvas.GetLeft(element)); + Canvas.SetTop(_highlightRect, Canvas.GetTop(element)); + canvas.Children.Add(_highlightRect); + _highlightShown = true; + _highlightAnimation = new DoubleAnimation(); + _highlightAnimation.From = 0; + _highlightAnimation.To = 1; + _highlightAnimation.Duration = TimeSpan.FromSeconds(0.2); + _highlightAnimation.AutoReverse = true; + _highlightAnimation.RepeatBehavior = RepeatBehavior.Forever; + _highlightRect.BeginAnimation(Rectangle.OpacityProperty, _highlightAnimation); + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml new file mode 100644 index 000000000..320ce58aa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml @@ -0,0 +1,44 @@ + + + + + + + + MACHINE + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml.cs new file mode 100644 index 000000000..07d012966 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml.cs @@ -0,0 +1,28 @@ +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.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.MachineDesigner.Views +{ + /// + /// Interaction logic for MachineDetailsView.xaml + /// + public partial class MachineDetailsView : UserControl + { + public MachineDetailsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml index 1ea8d2a74..ded14930a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml @@ -133,7 +133,7 @@ + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml.cs new file mode 100644 index 000000000..776a922ca --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml.cs @@ -0,0 +1,28 @@ +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.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.MachineDesigner.Views +{ + /// + /// Interaction logic for MachinesView.xaml + /// + public partial class MachinesView : UserControl + { + public MachinesView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml index e25a64c5e..0ffcf400a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml @@ -3,812 +3,17 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner" - xmlns:fa="http://schemas.fontawesome.io/icons/" - xmlns:providers="clr-namespace:Tango.MachineStudio.MachineDesigner.AutoComplete" - xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" - xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels" - xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - - - - - - - - - + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - - - - - - - - - - - - - - - - - - - - - - MACHINE DESIGNER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Hardware Version - - - - - - Add IDS - - - - - - Remove IDS - - - - - - - - - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NO IDS PACKS - - - - - - - - - - - - - - - - - - - - - Touch Panel - - - - - - Embedded Firmware - - - - - - Dispensers - - - - - - Mid Tanks - - - - - - Cartridges - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IDS PACKS - - - - - - - - - - Dispenser: - - - - Mid Tank: - - - - Cartridge: - - - - Liquid: - - - - Formula: - - - - - - - - - - - - - - - - - - - - - - - - - Serial Number - - - Machine Name - - - Machine Version - - - - - - - - - - Organization - - - - Enable Synchronization - - - - Configuration Name - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - v - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - v - - - - - - - - - - - - - - - - - - - - - - - v - - - - - - - - - - - - - - - - - - - - - - - v - - - - - - - - - - - - - - - - - - - - - - - v - - - - - - - - - - - - - - - - - - - - - - - v - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs index 9c7496484..7e1b60a28 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -10,163 +9,28 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; -using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; -using Tango.BL.Entities; -using Tango.DragAndDrop; -using Tango.MachineStudio.MachineDesigner.ViewModels; +using Tango.Core.DI; +using Tango.MachineStudio.MachineDesigner.Contracts; namespace Tango.MachineStudio.MachineDesigner.Views { /// /// Interaction logic for MainView.xaml /// - public partial class MainView : UserControl + public partial class MainView : UserControl , IMainView { - private MainViewVM _vm; - private Rectangle _highlightRect; - private bool _highlightShown; - private DoubleAnimation _highlightAnimation; - - public ColumnDefinition PanelColumnDefinition { get; set; } - public MainView() { InitializeComponent(); - - PanelColumnDefinition = panelColumnDefinition; - - DraggingSurface = dragSufrace; - this.Loaded += (x, y) => - { - _vm = DataContext as MainViewVM; - }; - - DragAndDropService.DragStarted += DragAndDropService_DragStarted; - DragAndDropService.DragEnded += DragAndDropService_DragEnded; - - _highlightRect = new Rectangle(); - _highlightRect.IsHitTestVisible = false; - _highlightRect.Stroke = Application.Current.Resources["AccentColorBrush"] as Brush; - _highlightRect.StrokeThickness = 2; - _highlightRect.StrokeDashArray = new DoubleCollection(new double[] { 3, 3, 3, 3 }); - } - - private void DragAndDropService_DragEnded(object sender, FrameworkElement e) - { - canvas.Children.Remove(_highlightRect); - _highlightShown = false; - _highlightRect.BeginAnimation(Rectangle.OpacityProperty, null); - } - - private void DragAndDropService_DragStarted(object sender, FrameworkElement e) - { - if (e.DataContext is HardwareVersion) - { - SetHighlightRegion(hardwareGrid); - } - else if (e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion || e.DataContext is ApplicationFirmwareVersion) - { - SetHighlightRegion(gridTablet); - } - else if (e.DataContext is EmbeddedFirmwareVersion) - { - SetHighlightRegion(gridEmbedded); - } - else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType || e.DataContext is IdsPackFormula) - { - SetHighlightRegion(gridIds); - } - } - - 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)); - - private void OnDropOnIdsPack(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is DispenserType) - { - _vm.DropDispenserType(e.Draggable.DataContext as DispenserType, e.Droppable.DataContext as IdsPack); - } - else if (e.Draggable.DataContext is LiquidType) - { - _vm.DropLiquidType(e.Draggable.DataContext as LiquidType, e.Droppable.DataContext as IdsPack); - } - else if (e.Draggable.DataContext is CartridgeType) - { - _vm.DropCartridgeType(e.Draggable.DataContext as CartridgeType, e.Droppable.DataContext as IdsPack); - } - else if (e.Draggable.DataContext is MidTankType) - { - _vm.DropMidTankType(e.Draggable.DataContext as MidTankType, e.Droppable.DataContext as IdsPack); - } - else if (e.Draggable.DataContext is IdsPackFormula) - { - _vm.DropIdsFormula(e.Draggable.DataContext as IdsPackFormula, e.Droppable.DataContext as IdsPack); - } - else if (e.Draggable.DataContext is IdsPack) - { - _vm.DropIdsPack(e.Draggable.DataContext as IdsPack, e.Droppable.DataContext as IdsPack); - } - } - - private void OnTabletDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is ApplicationDisplayPanelVersion) - { - _vm.DropTouchPanel(e.Draggable.DataContext as ApplicationDisplayPanelVersion); - } - else if (e.Draggable.DataContext is ApplicationOsVersion) - { - _vm.DropApplicationOsVersion(e.Draggable.DataContext as ApplicationOsVersion); - } - else if (e.Draggable.DataContext is ApplicationFirmwareVersion) - { - _vm.DropApplicationFirmwareVersion(e.Draggable.DataContext as ApplicationFirmwareVersion); - } - } - - private void OnEmbeddedDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is EmbeddedFirmwareVersion) - { - _vm.DropEmbeddedFirmware(e.Draggable.DataContext as EmbeddedFirmwareVersion); - } - } - - private void MachineDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is HardwareVersion) - { - _vm.DropHardwareVersion(e.Draggable.DataContext as HardwareVersion); - } + TangoIOC.Default.Register(this); } - private void SetHighlightRegion(FrameworkElement element) + public void NavigateTo(MachineDesignerNavigationView view) { - if (!_highlightShown) - { - _highlightRect.Width = element.Width; - _highlightRect.Height = element.Height; - Canvas.SetLeft(_highlightRect, Canvas.GetLeft(element)); - Canvas.SetTop(_highlightRect, Canvas.GetTop(element)); - canvas.Children.Add(_highlightRect); - _highlightShown = true; - _highlightAnimation = new DoubleAnimation(); - _highlightAnimation.From = 0; - _highlightAnimation.To = 1; - _highlightAnimation.Duration = TimeSpan.FromSeconds(0.2); - _highlightAnimation.AutoReverse = true; - _highlightAnimation.RepeatBehavior = RepeatBehavior.Forever; - _highlightRect.BeginAnimation(Rectangle.OpacityProperty, _highlightAnimation); - } + navigationControl.NavigateTo(view.ToString()); } } } -- cgit v1.3.1