aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-01-30 14:50:12 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-01-30 14:50:12 +0200
commitbfc9623f1b20c0a17e54bfbcdc59c43104afec78 (patch)
tree4c51f8cac7e22a5e5ce7bb95d2df439deebf7056 /Software/Visual_Studio/MachineStudio
parent7baca4061db66b1c5fde1c200f0d9323ba1be23f (diff)
downloadTango-bfc9623f1b20c0a17e54bfbcdc59c43104afec78.tar.gz
Tango-bfc9623f1b20c0a17e54bfbcdc59c43104afec78.zip
Added Data grid displaying all available recorded files for download.
Related Work Items: #5820
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj9
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs119
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs11
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml121
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config2
5 files changed, 217 insertions, 45 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj
index 065dec29e..ae05ca02c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj
@@ -53,6 +53,15 @@
<Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
+ <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
+ </Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs
index 41be789ed..68a886f99 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs
@@ -1,8 +1,11 @@
using Microsoft.Win32;
+using Microsoft.WindowsAPICodePack.Dialogs;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Data.Entity;
+using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
using Tango.BL;
@@ -10,6 +13,7 @@ using Tango.BL.ActionLogs;
using Tango.BL.DTO;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
+using Tango.BL.ValueObjects;
using Tango.Core.Commands;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.ThreadExtensions.Models;
@@ -21,9 +25,9 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
{
private INotificationProvider _notification;
private IActionLogManager _actionLogManager;
-
+
#region Properties
-
+
private string _threadName;
/// <summary>
/// Gets or sets the name of the thread. Using in print
@@ -51,7 +55,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
get { return _isSelected; }
set { _isSelected = value; RaisePropertyChangedAuto(); }
}
-
+
private RmlExtensionTestResult _testResult;
public RmlExtensionTestResult TestResult
@@ -59,19 +63,124 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
get { return _testResult; }
set { _testResult = value;
RaisePropertyChangedAuto();
+ RaisePropertyChanged(nameof(TestResultsFiles));
}
}
-
- #endregion
+ public List<RmlExtensionTestResultsFile> TestResultsFiles
+ {
+ get
+ {
+ return TestResult.RmlExtensionTestResultsFiles.ToList();
+ }
+ }
+ public RelayCommand<RmlExtensionTestResultsFile> DeleteCommand { get; set; }
+ public RelayCommand<RmlExtensionTestResultsFile> DownLoadFileCommand { get; set; }
+ public RelayCommand UploadCommand { get; set; }
+ public RelayCommand DownLoadAllCommand { get; set; }
+ #endregion
+
public TestResultViewVM(INotificationProvider notification, IActionLogManager actionLogManager)
{
_notification = notification;
_actionLogManager = actionLogManager;
+
+ UploadCommand = new RelayCommand(UploadFiles);
+ DownLoadFileCommand = new RelayCommand<RmlExtensionTestResultsFile>(DownLoadFile);
+ DeleteCommand = new RelayCommand<RmlExtensionTestResultsFile>(DeleteFile);
+ DownLoadAllCommand = new RelayCommand(DownLoadAllFiles);
}
+
+ #region TestResultsFiles
+ private async void UploadFiles(object obj)
+ {
+ OpenFileDialog dlg = new OpenFileDialog();
+ dlg.Title = "Select data file";
+ dlg.Filter = "CSV Files|*.csv";
+ dlg.Multiselect = true;
+ if (dlg.ShowDialog().Value)
+ {
+ try
+ {
+ var files = dlg.FileNames.ToList();
+
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ var testResult = await db.RmlExtensionTestResults.Where(x => x.Guid == TestResult.Guid).Include(t1 => t1.RmlExtensionTestResultsFiles).FirstOrDefaultAsync();
+ foreach (var strpath in files)
+ {
+ var testResultfile = new RmlExtensionTestResultsFile();
+ testResultfile.FileName = Path.GetFileName(strpath);
+ //temporary!!!
+ testResultfile.FilePath = strpath;
+
+ // TestResult.RmlExtensionTestResultsFiles.Add(testResultfile);
+ testResult.RmlExtensionTestResultsFiles.Add(testResultfile);
+ }
+ if (testResult != null)
+ {
+ await db.SaveChangesAsync();
+ }
+ TestResult.RmlExtensionTestResultsFiles = testResult.RmlExtensionTestResultsFiles;///?????
+ RaisePropertyChanged(nameof(TestResultsFiles));
+ }
+ _notification.ShowInfo("File successfully loaded.");
+ }
+ catch (Exception ex)
+ {
+ _notification.ShowError($"An error occurred while trying to import the file.\n{ex.FlattenMessage()}");
+ }
+ }
+
+ }
+
+ private void DownLoadFile(RmlExtensionTestResultsFile file)
+ {
+ SaveFileDialog dlg = new SaveFileDialog();
+ dlg.Title = "Save the csv file";
+ dlg.Filter = "CSV Files|*.csv";
+ dlg.DefaultExt = ".csv";
+ dlg.FileName = file.FileName;
+ if (dlg.ShowDialog().Value)
+ {
+ ///
+ }
+ }
+
+ private void DownLoadAllFiles()
+ {
+ CommonOpenFileDialog dlg = new CommonOpenFileDialog();
+ dlg.Title = "Select folder.";
+ dlg.IsFolderPicker = true;
+ if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
+ {
+ var filesPath = TestResult.RmlExtensionTestResultsFiles.Select( x=>x.FilePath).ToList();
+ /////
+ }
+ }
+
+ private async void DeleteFile(RmlExtensionTestResultsFile file)
+ {
+ if (_notification.ShowQuestion("Are you sure you want to delete the selected file?"))
+ {
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ var deletefile = db.RmlExtensionTestResultsFiles.FirstOrDefault(x => x.Guid == file.Guid);
+ if(deletefile != null)
+ {
+ db.RmlExtensionTestResultsFiles.Remove(deletefile);
+ await db.SaveChangesAsync();
+ }
+ }
+ TestResult.RmlExtensionTestResultsFiles.Remove(file);
+ RaisePropertyChanged(nameof(TestResultsFiles));
+ }
+ }
+ #endregion
+
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs
index c1fb4497f..f639eb6e7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs
@@ -1,6 +1,8 @@
-using System;
+using Microsoft.Win32;
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -271,7 +273,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
using (_notification.PushTaskItem("Loading Test Results Parameters ..."))
{
- var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().BuildAsync();
+ var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().WithTestResultsFiles().BuildAsync();
SelectedTestResults = testResults.OrderBy(x => x.ResultIndex).ToSynchronizedObservableCollection();
foreach (var result in SelectedTestResults)
{
@@ -403,6 +405,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
#endregion
+ #region Excel
+
public async void LoadTestResultsExcel(List<TestResultsExcelModel> testResultsExcelModelList, string machineGUID, string machineSerialNumber)
{
try
@@ -556,5 +560,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
IsFree = true;
}
}
+
+ #endregion
+
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml
index b8a4b7f28..f6262b52d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml
@@ -158,33 +158,12 @@
</UserControl.Resources>
<Grid DataContext="{Binding TestResultsViewVM}">
- <Grid.RowDefinitions>
+ <!--<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0">
- <Button DockPanel.Dock="Top" HorizontalAlignment="Right" Width="170" Height="36" Margin="0 0 26 0" VerticalAlignment="Center" Command="{Binding SaveCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="ContentSaveAll" Width="24" Height="24" />
- <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE</TextBlock>
- </StackPanel>
- </Button>
- <!--<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
- <TextBlock Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock>
-
- <autoComplete:AutoCompleteTextBox Provider="{StaticResource MachinesProvider}" LoadingContent="Loading..." FontSize="20" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" materialDesign:HintAssist.Hint="Serial Number" DisplayMember="SerialNumber" Width="280">
- <autoComplete:AutoCompleteTextBox.ItemTemplate>
- <DataTemplate>
- <StackPanel>
- <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock>
- <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock>
- </StackPanel>
- </DataTemplate>
- </autoComplete:AutoCompleteTextBox.ItemTemplate>
- </autoComplete:AutoCompleteTextBox>
- </StackPanel>-->
- </DockPanel>
- <Grid Grid.Row="1" >
+ </Grid.RowDefinitions>-->
+
+ <Grid Grid.Row="1" Margin="0 8 0 0" >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="1*"/>
@@ -266,17 +245,16 @@
<Grid Grid.Column="0" MinWidth="600" HorizontalAlignment="Left" >
<Grid.RowDefinitions>
+ <RowDefinition Height="3*"/>
<RowDefinition Height="1*"/>
- <RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
-
- <Border Padding="10 10 20 10" Grid.ColumnSpan="2" BorderBrush="Transparent" BorderThickness="1" >
-
- <ScrollViewer VerticalScrollBarVisibility="Auto" >
+
+ <Border Padding="10 10 20 10" Grid.ColumnSpan="2" Grid.Row="0" BorderBrush="Transparent" BorderThickness="1" >
+ <ScrollViewer VerticalScrollBarVisibility="Auto" >
<Grid HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
@@ -289,8 +267,8 @@
</Grid.RowDefinitions>
<Border>
<StackPanel x:Name="DryerTempPanel" HorizontalAlignment="Stretch" Grid.Column="0" Grid.Row="0" >
- <DockPanel Margin="0 0 0 0">
- <Button DockPanel.Dock="Right" Margin="0 0 40 0" HorizontalAlignment="Left" Padding="0" Height="Auto" Width="200" Command="{Binding ApplyToProcessParametersCommand}" ToolTip="Apply to Process Parameters" VerticalContentAlignment="Center">
+ <DockPanel Margin="0 10 0 0">
+ <Button DockPanel.Dock="Right" Margin="0 0 40 0" HorizontalAlignment="Left" Padding="0" Width="200" Command="{Binding ApplyToProcessParametersCommand}" ToolTip="Apply to Process Parameters" VerticalContentAlignment="Center">
<TextBlock FontSize="14" Background="Transparent" VerticalAlignment="Center" Margin="0 2 0 0">Apply to Process Parameters</TextBlock>
</Button>
<TextBlock HorizontalAlignment="Center" FontSize="21" Margin="180 10 0 0"> Process Parameters</TextBlock>
@@ -386,7 +364,7 @@
</DataGrid>
</StackPanel>
- <StackPanel x:Name="TensionresultsPanel" Grid.Column="1" Grid.Row="0" Margin="0 10 0 0" >
+ <StackPanel x:Name="TensionresultsPanel" Grid.Column="1" Grid.Row="0" Margin="0 20 0 0" >
<TextBlock HorizontalAlignment="Center" FontSize="21"> Tension through the thread path</TextBlock>
<Border BorderThickness="1" BorderBrush="{StaticResource GrayBrush200}" Margin="0 10 20 10" >
<UniformGrid Columns="4" Background="{StaticResource TransparentBackgroundBrush}" HorizontalAlignment="Left" MinWidth="{ Binding ElementName=MechanicalPropertiesGrid, Path= ActualWidth }" >
@@ -627,7 +605,7 @@
</ScrollViewer>
</Border>
- <Grid Grid.Row="1" Grid.Column="1" Margin="0 0 20 40">
+ <Grid Grid.Row="1" Grid.Column="1" Margin="0 0 20 20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="1*"/>
@@ -637,16 +615,83 @@
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
- <TextBlock FontSize="21" HorizontalAlignment="Left" Margin="0 10 0 0">Conclusion:</TextBlock>
+ <TextBlock FontSize="21" HorizontalAlignment="Left" VerticalAlignment="Center">Conclusion:</TextBlock>
<TextBox Grid.Column="1" Margin="20 0 20 0" HorizontalAlignment="Stretch" Height="46" Text="{Binding SelectedTab.TestResult.Conclusions}" Style="{StaticResource Rounded_Corners_TextBox_Multiline}"></TextBox>
- <TextBlock Grid.Row="1" FontSize="21" Margin="0 30 0 0" HorizontalAlignment="Left">Comments:</TextBlock>
- <TextBox Grid.Column="1" Grid.Row="1" Margin="20 20 20 0" Style="{StaticResource Rounded_Corners_TextBox_Multiline}" HorizontalAlignment="Stretch" Height="46" Text="{Binding SelectedTab.TestResult.Comment}"></TextBox>
+ <TextBlock Grid.Row="1" FontSize="21" HorizontalAlignment="Left" VerticalAlignment="Center">Comments:</TextBlock>
+ <TextBox Grid.Column="1" Grid.Row="1" Margin="20 0 20 0" Style="{StaticResource Rounded_Corners_TextBox_Multiline}" HorizontalAlignment="Stretch" Height="46" Text="{Binding SelectedTab.TestResult.Comment}" VerticalAlignment="Center"></TextBox>
</Grid>
+ <DockPanel Grid.Row="1" Grid.Column="0" Margin="20 0 20 20" x:Name="ImportExcelFile">
+ <DockPanel DockPanel.Dock="Top" Margin="0 0 20 0">
+ <Button Margin="10 0 0 0" Padding="2" Height="24" Cursor="Hand" Width="100" Command="{Binding SelectedTab.UploadCommand}" ToolTip="Upload selected files">Upload</Button>
+ <Button DockPanel.Dock="Right" Margin="0 0 10 0" HorizontalAlignment="Right" Padding="2" Height="24" Cursor="Hand" Width="100" Command="{Binding SelectedTab.DownLoadAllCommand}" ToolTip="Upload selected files">Download All</Button>
+ </DockPanel>
+
+ <Grid DockPanel.Dock="Bottom" Margin="0 0 20 0">
+ <DataGrid Margin="10" RowHeight="30" Padding="0" SelectionUnit="FullRow" BorderBrush="{StaticResource DarkGrayBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding SelectedTab.TestResultsFiles}" IsReadOnly="True"
+ ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto" MinHeight="100">
+ <DataGrid.ColumnHeaderStyle >
+ <Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
+ <Setter Property="FontSize" Value="16"/>
+ <Setter Property="HorizontalAlignment" Value="Left"/>
+ <Setter Property="Margin" Value="2 0 0 0"/>
+ <Setter Property="Padding" Value="0 5"/>
+ <Setter Property="FrameworkElement.HorizontalAlignment" Value="Stretch"/>
+ <Setter Property="HorizontalContentAlignment" Value="Left"/>
+ </Style>
+ </DataGrid.ColumnHeaderStyle>
+ <DataGrid.CellStyle>
+ <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+ <Setter Property="Padding" Value="0"></Setter>
+ <Setter Property="Margin" Value="0 0 0 0"></Setter>
+ </Style>
+ </DataGrid.CellStyle>
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="File Name" Binding="{Binding FileName}" Width="1*" FontSize="16"/>
+ <DataGridTextColumn Header="Progress" Width="1*" />
+ <DataGridTemplateColumn Header="DownLoad" Width="140">
+ <DataGridTemplateColumn.CellTemplate>
+ <DataTemplate>
+ <Button Style="{StaticResource emptyButton}" Cursor="Hand" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid},AncestorLevel=2},Path=DataContext.SelectedTab.DownLoadFileCommand}" CommandParameter="{Binding}">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock FontSize="16" Text="Download" VerticalAlignment="Center"></TextBlock>
+ <materialDesign:PackIcon VerticalAlignment="Center" Margin="5 0 0 0" Kind="Download" Width="18" />
+ </StackPanel>
+ </Button>
+ </DataTemplate>
+ </DataGridTemplateColumn.CellTemplate>
+ </DataGridTemplateColumn>
+ <DataGridTemplateColumn Header="Delete" Width="140">
+ <DataGridTemplateColumn.CellTemplate>
+ <DataTemplate>
+ <Button Style="{StaticResource emptyButton}" Cursor="Hand" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid},AncestorLevel=2},Path=DataContext.SelectedTab.DeleteCommand}" CommandParameter="{Binding}">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock FontSize="16" Text="Delete" VerticalAlignment="Center"></TextBlock>
+ <materialDesign:PackIcon VerticalAlignment="Center" Margin="5 0 0 0" Kind="Delete" Width="18" />
+ </StackPanel>
+ </Button>
+ </DataTemplate>
+ </DataGridTemplateColumn.CellTemplate>
+ </DataGridTemplateColumn>
+ </DataGrid.Columns>
+ </DataGrid>
+ </Grid>
+ </DockPanel>
</Grid>
</Grid>
</Grid>
-
+ <DockPanel VerticalAlignment="Top">
+ <Button DockPanel.Dock="Top" HorizontalAlignment="Right" Width="170" Height="36" Margin="0 0 26 0" VerticalAlignment="Center" Command="{Binding SaveCommand}">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="ContentSaveAll" Width="24" Height="24" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE</TextBlock>
+ </StackPanel>
+ </Button>
+
+ </DockPanel>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config
index da5ed8abc..f9bce0fbf 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config
@@ -6,6 +6,8 @@
<package id="MahApps.Metro" version="1.5.0" targetFramework="net461" />
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net461" />
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net461" />
+ <package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.0" targetFramework="net461" />
+ <package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="OxyPlot.Core" version="2.0.0" targetFramework="net461" />
<package id="OxyPlot.Wpf" version="2.0.0" targetFramework="net461" />