From 9e6d1ddfb42c4e8357bd75c2b1d6f84df1ea1966 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 29 Nov 2018 13:15:09 +0200 Subject: Working on machine studio storage module. --- .../Views/MainView.xaml | 306 +++++++++++++++++---- .../Views/MainView.xaml.cs | 21 ++ 2 files changed, 268 insertions(+), 59 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml index 46ef31c6b..a4a5c2946 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml @@ -11,22 +11,76 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.Storage.Views" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="1080" x:Name="control" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - + - + + + + - ACTIONS + ACTIONS - + + + + + + + + + + + + @@ -34,13 +88,16 @@ + + + - - @@ -55,21 +112,21 @@ Capacity: - + Free Space: - + - - + @@ -81,54 +138,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FILE TRANSFERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml.cs index be7e82ca5..5da808b8c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml.cs @@ -12,6 +12,8 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Integration.Storage; +using Tango.MachineStudio.Storage.ViewModels; namespace Tango.MachineStudio.Storage.Views { @@ -20,9 +22,28 @@ namespace Tango.MachineStudio.Storage.Views /// public partial class MainView : UserControl { + private MainViewVM _vm; + public MainView() { InitializeComponent(); + Loaded += (_, __) => + { + _vm = DataContext as MainViewVM; + _vm.CurrentFolderChanged += _vm_CurrentFolderChanged; + }; + + } + + private void _vm_CurrentFolderChanged(object sender, EventArgs e) + { + ScrollViewer scrollViewer = gridStorageItems.FindChild(); + scrollViewer.ScrollToVerticalOffset(0); + } + + private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + _vm.OnStorageItemDoubleClicked(gridStorageItems.SelectedItem as StorageItem); } } } -- cgit v1.3.1