aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml21
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml39
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml.cs89
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionView.xaml10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionsView.xaml38
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml121
7 files changed, 294 insertions, 52 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml
new file mode 100644
index 000000000..c529eabe0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml
@@ -0,0 +1,21 @@
+<UserControl x:Class="Tango.MachineStudio.ThreadExtensions.Views.AddItemDialog"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ 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:vm="clr-namespace:Tango.MachineStudio.ThreadExtensions.ViewModels"
+ xmlns:global="clr-namespace:Tango.MachineStudio.ThreadExtensions"
+ xmlns:local="clr-namespace:Tango.MachineStudio.ThreadExtensions.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="650" d:DesignWidth="800" Background="{StaticResource Dialog.Background}" Foreground="{StaticResource MainWindow.Foreground}" d:DataContext="{d:DesignInstance Type=vm:AddItemDialogVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.AddItemDialogVM}">
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="New Item Name" VerticalAlignment="Center" Margin="0 20 0 0" FontSize="20"></TextBlock>
+ <TextBox Name="ItemlName" TextAlignment="Left" FontSize="21" MinWidth="250" Margin="0 20 10 10" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" ></TextBox>
+ <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
+ <Button Name="AddItem" Command="{Binding SaveCommand}" Width="Auto" HorizontalAlignment="Right" Margin="0 40 10 10">SAVE</Button>
+ <Button Command="{Binding CancelCommand}" Width="Auto" HorizontalAlignment="Right" Margin="0 40 10 10">CANCEL</Button>
+ </StackPanel>
+ </StackPanel>
+ </Grid>
+</UserControl> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml.cs
new file mode 100644
index 000000000..6bd81343e
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.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.ThreadExtensions.Views
+{
+ /// <summary>
+ /// Interaction logic for AddItemDialog.xaml
+ /// </summary>
+ public partial class AddItemDialog : UserControl
+ {
+ public AddItemDialog()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml
new file mode 100644
index 000000000..88b1bbc62
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml
@@ -0,0 +1,39 @@
+<UserControl x:Class="Tango.MachineStudio.ThreadExtensions.Views.ComboboxEditable"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:local="clr-namespace:Tango.MachineStudio.ThreadExtensions.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <Grid>
+ <DockPanel>
+ <Button Margin="2 0 0 0" Command="{Binding DeleteCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Delete" Height="12" Foreground="{StaticResource RedBrush100}" Width="12">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <Button Margin="2 0 0 0" Command="{Binding EditCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Pencil" Height="12" Foreground="{StaticResource MainWindow.Foreground}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+
+ <Button Margin="2 0 0 0" Command="{Binding AddCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Plus" Height="12" Foreground="{StaticResource BlueBrush100}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+
+ <ComboBox DockPanel.Dock="Left" VerticalAlignment="Center" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=ItemsSource}" SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=UserControl}}" IsEditable="False" Margin="0 0 0 0" Width="Auto"/>
+
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml.cs
new file mode 100644
index 000000000..e5b542f45
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml.cs
@@ -0,0 +1,89 @@
+using System;
+using System.Collections;
+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;
+using Tango.Core.Commands;
+
+namespace Tango.MachineStudio.ThreadExtensions.Views
+{
+ /// <summary>
+ /// Interaction logic for ComboboxEditable.xaml
+ /// </summary>
+ public partial class ComboboxEditable : UserControl
+ {
+ public ComboboxEditable()
+ {
+ InitializeComponent();
+ }
+
+
+ public IEnumerable ItemsSource
+ {
+ get { return (IEnumerable)GetValue(ItemsSourceProperty); }
+ set { SetValue(ItemsSourceProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for ItemsSource. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty ItemsSourceProperty =
+ DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ComboboxEditable), new PropertyMetadata(null));
+
+
+
+ public object SelectedItem
+ {
+ get { return (object)GetValue(SelectedItemProperty); }
+ set { SetValue(SelectedItemProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for SelectedItem. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty SelectedItemProperty =
+ DependencyProperty.Register("SelectedItem", typeof(object), typeof(ComboboxEditable), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
+
+
+
+
+
+ public RelayCommand AddCommand
+ {
+ get { return (RelayCommand)GetValue(AddCommandProperty); }
+ set { SetValue(AddCommandProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for DeleteCommand. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty AddCommandProperty =
+ DependencyProperty.Register("AddCommand", typeof(RelayCommand), typeof(ComboboxEditable));
+
+ public RelayCommand EditCommand
+ {
+ get { return (RelayCommand)GetValue(EditCommandProperty); }
+ set { SetValue(EditCommandProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for DeleteCommand. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty EditCommandProperty =
+ DependencyProperty.Register("EditCommand", typeof(RelayCommand), typeof(ComboboxEditable));
+
+ public RelayCommand DeleteCommand
+ {
+ get { return (RelayCommand)GetValue(DeleteCommandProperty); }
+ set { SetValue(DeleteCommandProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for DeleteCommand. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty DeleteCommandProperty =
+ DependencyProperty.Register("DeleteCommand", typeof(RelayCommand), typeof(ComboboxEditable));
+
+
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionView.xaml
index 7e9d85f49..cd131d76d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionView.xaml
@@ -18,6 +18,7 @@
<UserControl.Resources>
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter"/>
+ <localconv:ComboBoxVisibleConverter x:Key="ComboBoxVisibleConverter"/>
<ObjectDataProvider x:Key="RMLExtensionStatus" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
<ObjectDataProvider.MethodParameters>
@@ -43,6 +44,15 @@
<TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
+ <ComboBox.ItemContainerStyle>
+ <Style TargetType="ComboBoxItem">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Path=Content, RelativeSource={RelativeSource Self},Converter={StaticResource ComboBoxVisibleConverter}}" Value="true">
+ <Setter Property="Visibility" Value="Collapsed"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ComboBox.ItemContainerStyle>
</ComboBox>
</StackPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionsView.xaml
index 6a1436348..b2bff1dae 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/RMLExtensionsView.xaml
@@ -33,26 +33,6 @@
<Grid DockPanel.Dock="Bottom">
<StackPanel>
<Grid>
- <!--<StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0">
- <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveRmlExtensionCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" />
- <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock>
- </StackPanel>
- </Button>
- <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}" Command="{Binding CloneRmlExtensionCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="ContentCopy" Width="20" Height="20" />
- <TextBlock Margin="5 0 0 0" FontSize="16">DUPLICATE</TextBlock>
- </StackPanel>
- </Button>
- <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddRmlExtCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" />
- <TextBlock Margin="5 0 0 0" FontSize="16">NEW</TextBlock>
- </StackPanel>
- </Button>
- </StackPanel>-->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Margin="50 0 0 0" MinWidth="200" Height="60" Command="{Binding ManageRmlExtensionCommand}">
<StackPanel Orientation="Horizontal">
@@ -64,19 +44,7 @@
</Grid>
<StackPanel Orientation="Horizontal" Margin="0 40 0 0">
- <!--<Button Command="{Binding ImportRMLFileCommand}" Foreground="{StaticResource BlackForegroundBrush}" FontSize="16" Style="{StaticResource emptyButton}" Cursor="Hand">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="FileImport" VerticalAlignment="Center" Width="30" Height="30" />
- <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" TextDecorations="Underline">Import Thread File</TextBlock>
- </StackPanel>
- </Button>
-
- <Button Margin="30 0 0 0" Command="{Binding ExportRMLFileCommand}" Foreground="{StaticResource BlackForegroundBrush}" FontSize="16" Style="{StaticResource emptyButton}" Cursor="Hand">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="FileExport" VerticalAlignment="Center" Width="30" Height="30" />
- <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" TextDecorations="Underline">Export Thread File</TextBlock>
- </StackPanel>
- </Button>-->
+
</StackPanel>
</StackPanel>
</Grid>
@@ -88,7 +56,7 @@
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
<Setter Property="Padding" Value="4"></Setter>
- <Setter Property="Margin" Value="0 5 0 0"></Setter>
+ <Setter Property="Margin" Value="0 0 0 0"></Setter>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
@@ -99,7 +67,7 @@
<DataGridTextColumn Header="CREATED BY" Binding="{Binding CreatedBy}" Width="Auto"/>
<DataGridTextColumn Header="CREATED" Binding="{Binding Created,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="Auto" />
<DataGridTextColumn Header="LAST UPDATED" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="Auto" />
- <DataGridTextColumn Header="STATUS" Binding="{Binding Status, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto" />
+ <DataGridTextColumn Header="STATUS" Binding="{Binding Status, Converter={StaticResource EnumToDescriptionConverter}}" Width="1*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml
index 707991f0e..0f1003a63 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml
@@ -15,7 +15,7 @@
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
FontSize="16"
- d:DesignHeight="450" d:DesignWidth="1200" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
+ d:DesignHeight="850" d:DesignWidth="1200" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter"/>
@@ -56,22 +56,100 @@
</Style>
</controls:TableGrid.Resources>
<TextBlock Text="Manufacturer:" VerticalAlignment="Center" FontSize="16" Margin="0 3 0 0"></TextBlock>
- <ComboBox VerticalAlignment="Center" ItemsSource="{Binding Manufacturers}" SelectedItem="{Binding ActiveRML.Manufacturer,Mode=TwoWay}" IsEditable="False" Margin="20 0 20 0"/>
-
+ <local:ComboboxEditable ItemsSource="{Binding Manufacturers}" SelectedItem="{Binding ActiveRML.Manufacturer,Mode=TwoWay}" DeleteCommand="{Binding DeleteBrandItemCommand}" AddCommand="{Binding AddManufacturerItemCommand}" EditCommand="{Binding EditManufacturerItemCommand}"/>
+
<TextBlock Text="Brand:" VerticalAlignment="Center" ></TextBlock>
- <ComboBox ItemsSource="{Binding Brands}" SelectedItem="{Binding ActiveRMLExtension.YarnBrand,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True" Margin="20 0 20 0"></ComboBox>
-
+ <local:ComboboxEditable ItemsSource="{Binding Brands}" SelectedItem="{Binding ActiveRMLExtension.YarnBrand,Mode=TwoWay}" DeleteCommand="{Binding DeleteBrandItemCommand}" AddCommand="{Binding AddBrandItemCommand}" EditCommand="{Binding EditBrandItemCommand}"/>
+
<TextBlock Text="Country:" ></TextBlock>
<TextBox Text="{Binding ActiveRMLExtension.Country,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"></TextBox>
<TextBlock Text="End Use:" ></TextBlock>
- <ComboBox ItemsSource="{Binding EndUse}" SelectedItem="{Binding ActiveRML.MediaPurpose,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding EndUse}" SelectedItem="{Binding ActiveRML.MediaPurpose,Mode=TwoWay}" DeleteCommand="{Binding DeleteEndUseItemCommand}" AddCommand="{Binding AddEndUseItemCommand}" EditCommand="{Binding EditEndUseItemCommand}"/>
+
+ <!--<DockPanel>
+ <Button Margin="2 0 0 0" Command="{Binding DeleteEndUseItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Delete" Height="12" Foreground="{StaticResource RedBrush100}" Width="12">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <Button Margin="2 0 0 0" Command="{Binding EditEndUseItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Pencil" Height="12" Foreground="{StaticResource MainWindow.Foreground}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+
+ <Button Margin="2 0 0 0" Command="{Binding AddEndUseItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Plus" Height="12" Foreground="{StaticResource BlueBrush100}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <ComboBox DockPanel.Dock="Left" ItemsSource="{Binding EndUse}" SelectedItem="{Binding ActiveRML.MediaPurpose,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ </DockPanel>-->
<TextBlock Text="Applications:" ></TextBlock>
- <ComboBox ItemsSource="{Binding Applications}" SelectedItem="{Binding ActiveRMLExtension.YarnApplication,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding Applications}" SelectedItem="{Binding ActiveRMLExtension.YarnApplication,Mode=TwoWay}" DeleteCommand="{Binding DeleteApplicationItemCommand}" AddCommand="{Binding AddApplicationItemCommand}" EditCommand="{Binding EditApplicationItemCommand}"/>
+
+ <!--<DockPanel>
+ <Button Margin="2 0 0 0" Command="{Binding DeleteApplicationItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Delete" Height="12" Foreground="{StaticResource RedBrush100}" Width="12">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <Button Margin="2 0 0 0" Command="{Binding EditApplicationItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Pencil" Height="12" Foreground="{StaticResource MainWindow.Foreground}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+
+ <Button Margin="2 0 0 0" Command="{Binding AddApplicationItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Plus" Height="12" Foreground="{StaticResource BlueBrush100}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <ComboBox DockPanel.Dock="Left" ItemsSource="{Binding Applications}" SelectedItem="{Binding ActiveRMLExtension.YarnApplication,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ </DockPanel>-->
<TextBlock Text="Industry Sector:" ></TextBlock>
- <ComboBox ItemsSource="{Binding IndustrySector}" SelectedItem="{Binding ActiveRMLExtension.YarnIndustrysector,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding IndustrySector}" SelectedItem="{Binding ActiveRMLExtension.YarnIndustrysector}" DeleteCommand="{Binding DeleteIndustrySectorItemCommand}" AddCommand="{Binding AddIndustrySectorItemCommand}" EditCommand="{Binding EditIndustrySectorItemCommand}"/>
+
+ <!--<DockPanel>
+ <Button Margin="2 0 0 0" Command="{Binding DeleteIndustrySectorItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Delete" Height="12" Foreground="{StaticResource RedBrush100}" Width="12">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <Button Margin="2 0 0 0" Command="{Binding EditIndustrySectorItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Pencil" Height="12" Foreground="{StaticResource MainWindow.Foreground}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+
+ <Button Margin="2 0 0 0" Command="{Binding AddIndustrySectorItemCommand}" DockPanel.Dock="Right" Padding="0" Background="Transparent" BorderThickness="0">
+ <materialDesign:PackIcon Kind="Plus" Height="12" Foreground="{StaticResource BlueBrush100}" Width="12" FontWeight="UltraBold">
+ <materialDesign:PackIcon.LayoutTransform>
+ <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
+ </materialDesign:PackIcon.LayoutTransform>
+ </materialDesign:PackIcon>
+ </Button>
+ <ComboBox DockPanel.Dock="Left" ItemsSource="{Binding IndustrySector}" SelectedItem="{Binding ActiveRMLExtension.YarnIndustrysector,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ </DockPanel>-->
</controls:TableGrid>
</DockPanel>
@@ -92,31 +170,40 @@
</Style>
</controls:TableGrid.Resources>
<TextBlock Text="Material:" ></TextBlock>
- <ComboBox ItemsSource="{Binding Materials}" SelectedItem="{Binding ActiveRML.MediaMaterial}" DisplayMemberPath="Name" IsEditable="False"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding Materials}" SelectedItem="{Binding ActiveRML.MediaMaterial}" DeleteCommand="{Binding DeleteMaterialItemCommand}" AddCommand="{Binding AddMaterialItemCommand}" EditCommand="{Binding EditMaterialItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding Materials}" SelectedItem="{Binding ActiveRML.MediaMaterial}" DisplayMemberPath="Name" IsEditable="False"></ComboBox>-->
<TextBlock Text="Type:" ></TextBlock>
- <ComboBox ItemsSource="{Binding YarnTypes}" SelectedItem="{Binding ActiveRMLExtension.YarnType,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding YarnTypes}" SelectedItem="{Binding ActiveRMLExtension.YarnType}" DeleteCommand="{Binding DeleteYarnTypeItemCommand}" AddCommand="{Binding AddYarnTypeItemCommand}" EditCommand="{Binding EditYarnTypeItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding YarnTypes}" SelectedItem="{Binding ActiveRMLExtension.YarnType,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Sub family:" ></TextBlock>
- <ComboBox ItemsSource="{Binding SubFamilies}" SelectedItem="{Binding ActiveRMLExtension.YarnSubFamily,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding SubFamilies}" SelectedItem="{Binding ActiveRMLExtension.YarnSubFamily}" DeleteCommand="{Binding DeleteSubFamilyItemCommand}" AddCommand="{Binding AddSubFamilyItemCommand}" EditCommand="{Binding EditSubFamilyItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding SubFamilies}" SelectedItem="{Binding ActiveRMLExtension.YarnSubFamily,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Family:" ></TextBlock>
- <ComboBox ItemsSource="{Binding Family}" SelectedItem="{Binding ActiveRMLExtension.YarnFamily,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding Family}" SelectedItem="{Binding ActiveRMLExtension.YarnFamily}" DeleteCommand="{Binding DeleteFamilyItemCommand}" AddCommand="{Binding AddFamilyItemCommand}" EditCommand="{Binding EditFamilyItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding Family}" SelectedItem="{Binding ActiveRMLExtension.YarnFamily,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Group:" ></TextBlock>
- <ComboBox ItemsSource="{Binding Group}" SelectedItem="{Binding ActiveRMLExtension.YarnGroup,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding Group}" SelectedItem="{Binding ActiveRMLExtension.YarnGroup}" DeleteCommand="{Binding DeleteGroupItemCommand}" AddCommand="{Binding AddGroupItemCommand}" EditCommand="{Binding EditGroupItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding Group}" SelectedItem="{Binding ActiveRMLExtension.YarnGroup,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Texturing:" ></TextBlock>
- <ComboBox ItemsSource="{Binding Texturing}" SelectedItem="{Binding ActiveRMLExtension.YarnTexturing,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding Texturing}" SelectedItem="{Binding ActiveRMLExtension.YarnTexturing}" DeleteCommand="{Binding DeleteTexturingItemCommand}" AddCommand="{Binding AddTexturingItemCommand}" EditCommand="{Binding EditTexturingItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding Texturing}" SelectedItem="{Binding ActiveRMLExtension.YarnTexturing,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Geometry:" ></TextBlock>
- <ComboBox ItemsSource="{Binding Geometry }" SelectedItem="{Binding ActiveRML.FiberShape ,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding Geometry}" SelectedItem="{Binding ActiveRML.FiberShape}" DeleteCommand="{Binding DeleteGeometryItemCommand}" AddCommand="{Binding AddGeometryItemCommand}" EditCommand="{Binding EditGeometryItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding Geometry }" SelectedItem="{Binding ActiveRML.FiberShape ,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Thread Shade:" ></TextBlock>
- <ComboBox ItemsSource="{Binding YarnWhiteShade}" SelectedItem="{Binding ActiveRMLExtension.YarnWhiteShade,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding YarnWhiteShade}" SelectedItem="{Binding ActiveRMLExtension.YarnWhiteShade}" DeleteCommand="{Binding DeleteYarnWhiteShadeItemCommand}" AddCommand="{Binding AddYarnWhiteShadeItemCommand}" EditCommand="{Binding EditYarnWhiteShadeItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding YarnWhiteShade}" SelectedItem="{Binding ActiveRMLExtension.YarnWhiteShade,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
<TextBlock Text="Gloss level:" ></TextBlock>
- <ComboBox ItemsSource="{Binding GlossLevel }" SelectedItem="{Binding ActiveRMLExtension.YarnGlossLevel ,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>
+ <local:ComboboxEditable ItemsSource="{Binding GlossLevel}" SelectedItem="{Binding ActiveRMLExtension.YarnGlossLevel}" DeleteCommand="{Binding DeleteGlossLevelItemCommand}" AddCommand="{Binding AddGlossLevelItemCommand}" EditCommand="{Binding EditGlossLevelItemCommand}"/>
+ <!--<ComboBox ItemsSource="{Binding GlossLevel }" SelectedItem="{Binding ActiveRMLExtension.YarnGlossLevel ,Mode=TwoWay}" DisplayMemberPath="Name" IsEditable="True"></ComboBox>-->
</controls:TableGrid>
</DockPanel>
</Grid>