diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2021-07-18 21:14:11 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2021-07-18 21:14:11 +0300 |
| commit | 4f0e4d84676b0a8e10805e9614761fba5108f8f7 (patch) | |
| tree | d5f14216f7a317f96ecd674a0fc4021e58778da8 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions | |
| parent | 2fab3b692752114d8a0f76fce8eb49b7f0f435a6 (diff) | |
| download | Tango-4f0e4d84676b0a8e10805e9614761fba5108f8f7.tar.gz Tango-4f0e4d84676b0a8e10805e9614761fba5108f8f7.zip | |
Editable Combobox item in ColorParametersView.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions')
7 files changed, 404 insertions, 255 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs index ae90263d2..3a5488256 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs @@ -263,7 +263,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels public RelayCommand SaveCommand { get; set; } - public RelayCommand<FactorColors> FlytoRMLLiquidFactorsCommand { get; set; } + public RelayCommand SaveFactorsCommand { get; set; } public RelayCommand ImportCyanDataCommand { get; set; } public RelayCommand ImportMagentaDataCommand { get; set; } @@ -309,10 +309,6 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } } - private void FlytoRMLLiquidFactors(FactorColors obj) - { - throw new NotImplementedException(); - } private void ImportBlackData(object obj) { @@ -327,6 +323,13 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } } + private void SaveFactors(object obj) + { + /// var LiquidTypesRmls = ActiveRML.LiquidTypesRmls; + // for( int) + } + + private bool LoadColorDataFromExcel(out List<ColorDataExcelModel> items) { OpenFileDialog dlg = new OpenFileDialog(); @@ -388,7 +391,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels ImportYellowDataCommand = new RelayCommand(ImportYellowData); ImportBlackDataCommand = new RelayCommand(ImportBlackData); - FlytoRMLLiquidFactorsCommand = new RelayCommand<FactorColors>(FlytoRMLLiquidFactors, () => IsFree); + SaveFactorsCommand = new RelayCommand(SaveFactors, () => IsFree); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs index 928102f12..6c73ab63b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs @@ -27,6 +27,7 @@ using Tango.MachineStudio.ThreadExtensions.Contracts; using Tango.MachineStudio.ThreadExtensions.Views; using Tango.MachineStudio.ThreadExtensions.Models; using Tango.Settings; +using System.Reflection; namespace Tango.MachineStudio.ThreadExtensions.ViewModels { @@ -350,9 +351,10 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels #region Command Functions - private void AddManufacturerItem(object obj) + private async void AddManufacturerItem(object obj) { AddItemDialogVM vm = ViewModelLocator.AddItemDialogVM; + vm.Name = ""; _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, (x) => { @@ -361,34 +363,22 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels _notification.ShowError("Manufacturer already exists."); return; } - Manufacturers.Add(vm.Name); - RaisePropertyChanged("Manufacturers"); _active_context.YarnManufacturers.Add(new YarnManufacturer() { Name = vm.Name }); - }, () => { }); - } - - private void DeleteManufacturerItem(object obj) - { - if (_notification.ShowQuestion("Are you sure you want to delete the selected item?")) + if(vm.DialogResult) { - string deletedname = ActiveRML.Manufacturer; - Manufacturers.Remove(deletedname); - RaisePropertyChanged("Manufacturers"); - var deletedItem = _active_context.YarnManufacturers.Where(x => x.Name == deletedname).FirstOrDefault(); - if (deletedItem != null) - { - _active_context.YarnManufacturers.Remove(deletedItem); - ActiveRML.Manufacturer = _active_context.YarnManufacturers.FirstOrDefault().Name; - } + await _active_context.SaveChangesAsync(); + Manufacturers = _active_context.YarnManufacturers.Select(z => z.Name).ToList(); + ActiveRML.Manufacturer = Manufacturers.Where(z=> z == vm.Name).FirstOrDefault(); } } - - private void EditManufacturerItem(object obj) + + private async void EditManufacturerItem(object obj) { AddItemDialogVM vm = ViewModelLocator.AddItemDialogVM; vm.Name = ActiveRML.Manufacturer; + bool bChanged = false; _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, (x) => { @@ -404,90 +394,346 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels { editItem.Name = x.Name; ActiveRML.Manufacturer = x.Name; + bChanged = true; } Manufacturers = _active_context.YarnManufacturers.Select(z => z.Name).ToList(); }, () => { }); + if(bChanged) + await _active_context.SaveChangesAsync(); } - private void AddBrandItem(object obj) + private bool AddItemToCollection<T>( ObservableCollection<T> collection, DbSet<T> dbColection, ref string name) where T : class { AddItemDialogVM vm = ViewModelLocator.AddItemDialogVM; + vm.Name = ""; - _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, async (x) => - { - if (Brands.Any(y => y.Name.ToLower() == x.Name.ToLower())) - { - _notification.ShowError("Brand already exists."); - return; - } - YarnBrand newItem = new YarnBrand() { Name = x.Name }; - _active_context.YarnBrands.Add(newItem); - await _active_context.SaveChangesAsync(); - Brands = _active_context.YarnBrands.ToObservableCollection(); - ActiveRMLExtension.YarnBrand = Brands.FirstOrDefault(b => b.Name == vm.Name); - }, () => { }); + PropertyInfo pi = typeof(T).GetProperty("Name"); + bool returnValue = false; + _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, (x) => + { + if (String.IsNullOrEmpty(x.Name)) + { + returnValue = false; + return; + } + if (collection.Any(y => pi.GetValue(y).ToString().ToLower() == x.Name.ToLower())) + { + returnValue = false; + _notification.ShowError("The name already exists."); + return; + } + returnValue = true; + T newItem = (T)Activator.CreateInstance(typeof(T), new object[] { }); + pi.SetValue(newItem, x.Name); + dbColection.Add(newItem); + }, () => { }); + name = vm.Name; + return returnValue; } - private void EditBrandItem(object obj) + private bool EditItemCollection<T>(ObservableCollection<T> collection, DbSet<T> dbColection, ref string name) where T : class { AddItemDialogVM vm = ViewModelLocator.AddItemDialogVM; - vm.Name = ActiveRMLExtension.YarnBrand.Name; + vm.Name = name; + string currentName = name; - _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, async (x) => + PropertyInfo pi = typeof(T).GetProperty("Name"); + bool returnValue = false; + _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, (x) => { - if (ActiveRMLExtension.YarnBrand.Name == vm.Name) + if (String.IsNullOrEmpty(x.Name) || currentName == x.Name) + { + returnValue = false; return; - if (Brands.Any(y => y.Name == vm.Name)) + } + + if (collection.Any(y => pi.GetValue(y).ToString() == x.Name)) { - _notification.ShowError("The Brand already exists."); + returnValue = false; + _notification.ShowError("The name already exists."); return; } - ActiveRMLExtension.YarnBrand.Name = vm.Name; - await _active_context.SaveChangesAsync(); + returnValue = true; }, () => { }); + name = vm.Name; + return returnValue; } - private async void DeleteBrandItem(object obj) + + private async void AddBrandItem(object obj) { - if (_notification.ShowQuestion("Are you sure you want to delete the selected item?")) + string newName = ""; + if( AddItemToCollection( Brands, _active_context.YarnBrands, ref newName)) { - var deletedItem = _active_context.YarnBrands.Where(x => x.Guid == ActiveRMLExtension.YarnBrand.Guid).FirstOrDefault(); - if (deletedItem != null) - { - _active_context.YarnBrands.Remove(deletedItem); - await _active_context.SaveChangesAsync(); - Brands = _active_context.YarnBrands.ToObservableCollection(); - ActiveRMLExtension.YarnBrand = Brands.FirstOrDefault(); - } + await _active_context.SaveChangesAsync(); + Brands = _active_context.YarnBrands.ToObservableCollection(); + ActiveRMLExtension.YarnBrand = Brands.FirstOrDefault(b => b.Name == newName); } } - - private void AddEndUseItem(object ob) + + private async void EditBrandItem(object obj) { - AddItemDialogVM vm = ViewModelLocator.AddItemDialogVM; + string newName = ActiveRMLExtension.YarnBrand.Name; + if (EditItemCollection(Brands, _active_context.YarnBrands, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnBrand.Name = newName; + await _active_context.SaveChangesAsync(); + } + } - _notification.ShowModalDialog<AddItemDialogVM, Views.AddItemDialog>(vm, async (x) => + private async void AddEndUseItem(object ob) + { + string newName = ""; + if (AddItemToCollection(EndUse, _active_context.MediaPurposes, ref newName)) { - if (Brands.Any(y => y.Name.ToLower() == x.Name.ToLower())) - { - _notification.ShowError("This item already exists."); - return; - } - MediaPurpos newItem = new MediaPurpos() { Name = x.Name }; - _active_context.MediaPurposes.Add(newItem); await _active_context.SaveChangesAsync(); EndUse = _active_context.MediaPurposes.ToObservableCollection(); - ActiveRML.MediaPurpose = EndUse.FirstOrDefault(b => b.Name == x.Name); - }, () => { }); + ActiveRML.MediaPurpose = EndUse.FirstOrDefault(b => b.Name == newName); + } } - private void EditEndUseItem(object ob) + private async void EditEndUseItem(object ob) { - + string newName = ActiveRML.MediaPurpose.Name; + if (EditItemCollection(EndUse, _active_context.MediaPurposes, ref newName)) + { + ActiveRML.LastUpdated = DateTime.UtcNow; + ActiveRML.MediaPurpose.Name = newName; + await _active_context.SaveChangesAsync(); + } } - private void DeleteEndUseItem(object ob) + + private async void AddApplicationItem(object ob) { - + string newName = ""; + if (AddItemToCollection(Applications, _active_context.YarnApplications, ref newName)) + { + await _active_context.SaveChangesAsync(); + Applications = _active_context.YarnApplications.ToObservableCollection(); + ActiveRMLExtension.YarnApplication = Applications.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditApplicationItem(object ob) + { + string newName = ActiveRMLExtension.YarnApplication.Name; + if (EditItemCollection(Applications, _active_context.YarnApplications, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnApplication.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddIndustrySectorItem(object ob) + { + string newName = ""; + if (AddItemToCollection(IndustrySector, _active_context.YarnIndustrysectors, ref newName)) + { + await _active_context.SaveChangesAsync(); + IndustrySector = _active_context.YarnIndustrysectors.ToObservableCollection(); + ActiveRMLExtension.YarnIndustrysector = IndustrySector.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditIndustrySectorItem(object ob) + { + string newName = ActiveRMLExtension.YarnIndustrysector.Name; + if (EditItemCollection(IndustrySector, _active_context.YarnIndustrysectors, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnIndustrysector.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddMaterialItem(object ob) + { + string newName = ""; + if (AddItemToCollection(Materials, _active_context.MediaMaterials, ref newName)) + { + await _active_context.SaveChangesAsync(); + Materials = _active_context.MediaMaterials.ToObservableCollection(); + ActiveRML.MediaMaterial = Materials.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditMaterialItem(object ob) + { + string newName = ActiveRML.MediaMaterial.Name; + if (EditItemCollection(Materials, _active_context.MediaMaterials, ref newName)) + { + ActiveRML.LastUpdated = DateTime.UtcNow; + ActiveRML.MediaMaterial.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddYarnTypeItem(object ob) + { + string newName = ""; + if (AddItemToCollection(YarnTypes, _active_context.YarnTypes, ref newName)) + { + await _active_context.SaveChangesAsync(); + YarnTypes = _active_context.YarnTypes.ToObservableCollection(); + ActiveRMLExtension.YarnType = YarnTypes.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditYarnTypeItem(object ob) + { + string newName = ActiveRMLExtension.YarnType.Name; + if (EditItemCollection(YarnTypes, _active_context.YarnTypes, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnType.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddSubFamilyItem(object ob) + { + string newName = ""; + if (AddItemToCollection(SubFamilies, _active_context.YarnSubFamilies, ref newName)) + { + await _active_context.SaveChangesAsync(); + SubFamilies = _active_context.YarnSubFamilies.ToObservableCollection(); + ActiveRMLExtension.YarnSubFamily = SubFamilies.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditSubFamilyItem(object ob) + { + string newName = ActiveRMLExtension.YarnSubFamily.Name; + if (EditItemCollection(SubFamilies, _active_context.YarnSubFamilies, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnSubFamily.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddFamilyItem(object ob) + { + string newName = ""; + if (AddItemToCollection(Family, _active_context.YarnFamilies, ref newName)) + { + await _active_context.SaveChangesAsync(); + Family = _active_context.YarnFamilies.ToObservableCollection(); + ActiveRMLExtension.YarnFamily = Family.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditFamilyItem(object ob) + { + string newName = ActiveRMLExtension.YarnFamily.Name; + if (EditItemCollection(Family, _active_context.YarnFamilies, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnFamily.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddGroupItem(object ob) + { + string newName = ""; + if (AddItemToCollection(Group, _active_context.YarnGroups, ref newName)) + { + await _active_context.SaveChangesAsync(); + Group = _active_context.YarnGroups.ToObservableCollection(); + ActiveRMLExtension.YarnGroup = Group.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditGroupItem(object ob) + { + string newName = ActiveRMLExtension.YarnGroup.Name; + if (EditItemCollection(Group, _active_context.YarnGroups, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnGroup.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddTexturingItem(object ob) + { + string newName = ""; + if (AddItemToCollection(Texturing, _active_context.YarnTexturings, ref newName)) + { + await _active_context.SaveChangesAsync(); + Texturing = _active_context.YarnTexturings.ToObservableCollection(); + ActiveRMLExtension.YarnTexturing = Texturing.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditTexturingItem(object ob) + { + string newName = ActiveRMLExtension.YarnTexturing.Name; + if (EditItemCollection(Texturing, _active_context.YarnTexturings, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnTexturing.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddGeometryItem(object ob) + { + string newName = ""; + if (AddItemToCollection(Geometry, _active_context.FiberShapes, ref newName)) + { + await _active_context.SaveChangesAsync(); + Geometry = _active_context.FiberShapes.ToObservableCollection(); + ActiveRML.FiberShape = Geometry.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditGeometryItem(object ob) + { + string newName = ActiveRML.FiberShape.Name; + if (EditItemCollection(Geometry, _active_context.FiberShapes, ref newName)) + { + ActiveRML.LastUpdated = DateTime.UtcNow; + ActiveRML.FiberShape.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddYarnWhiteShadeItem(object ob) + { + string newName = ""; + if (AddItemToCollection(YarnWhiteShade, _active_context.YarnWhiteShades, ref newName)) + { + await _active_context.SaveChangesAsync(); + YarnWhiteShade = _active_context.YarnWhiteShades.ToObservableCollection(); + ActiveRMLExtension.YarnWhiteShade = YarnWhiteShade.FirstOrDefault(b => b.Name == newName); + } + } + private async void EditYarnWhiteShadeItem(object ob) + { + string newName = ActiveRMLExtension.YarnWhiteShade.Name; + if (EditItemCollection(YarnWhiteShade, _active_context.YarnWhiteShades, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnWhiteShade.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + + private async void AddGlossLevelItem(object ob) + { + string newName = ""; + if (AddItemToCollection(GlossLevel, _active_context.YarnGlossLevels, ref newName)) + { + await _active_context.SaveChangesAsync(); + GlossLevel = _active_context.YarnGlossLevels.ToObservableCollection(); + ActiveRMLExtension.YarnGlossLevel = GlossLevel.FirstOrDefault(b => b.Name == newName); + } } + private async void EditGlossLevelItem(object ob) + { + string newName = ActiveRMLExtension.YarnGlossLevel.Name; + if (EditItemCollection(GlossLevel, _active_context.YarnGlossLevels, ref newName)) + { + ActiveRMLExtension.LastUpdated = DateTime.UtcNow; + ActiveRMLExtension.YarnGlossLevel.Name = newName; + await _active_context.SaveChangesAsync(); + } + } + #endregion @@ -501,39 +747,52 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels SaveCommand = new RelayCommand(Save, () => IsFree); ManageRmlExtensionCommand = new RelayCommand(() => LoadActiveRMLExtension(SelectedRMLExtension.Guid), () => SelectedRMLExtension != null); - DeleteManufacturerItemCommand = new RelayCommand(DeleteManufacturerItem, () => ActiveRML.Manufacturer != ""); + AddManufacturerItemCommand = new RelayCommand(AddManufacturerItem); EditManufacturerItemCommand = new RelayCommand(EditManufacturerItem, () => ActiveRML.Manufacturer != ""); AddBrandItemCommand = new RelayCommand(AddBrandItem); EditBrandItemCommand = new RelayCommand(EditBrandItem, () => ActiveRMLExtension.YarnBrand != null); - DeleteBrandItemCommand = new RelayCommand(DeleteBrandItem, () => ActiveRMLExtension.YarnBrand != null); - + AddEndUseItemCommand = new RelayCommand(AddEndUseItem); EditEndUseItemCommand = new RelayCommand(EditEndUseItem); - DeleteEndUseItemCommand = new RelayCommand(DeleteEndUseItem); - - AddApplicationItemCommand = new RelayCommand(AddEndUseItem); - EditApplicationItemCommand = new RelayCommand(EditEndUseItem); - DeleteApplicationItemCommand = new RelayCommand(DeleteEndUseItem); - - AddIndustrySectorItemCommand = new RelayCommand(AddEndUseItem); - EditIndustrySectorItemCommand = new RelayCommand(EditEndUseItem); - DeleteIndustrySectorItemCommand = new RelayCommand(DeleteEndUseItem); - - AddMaterialItemCommand = new RelayCommand(AddEndUseItem); - EditMaterialItemCommand = new RelayCommand(EditEndUseItem); - DeleteMaterialItemCommand = new RelayCommand(DeleteEndUseItem); - - AddYarnTypeItemCommand = new RelayCommand(AddEndUseItem); - EditYarnTypeItemCommand = new RelayCommand(EditEndUseItem); - DeleteYarnTypeItemCommand = new RelayCommand(DeleteEndUseItem); - } - - - + AddApplicationItemCommand = new RelayCommand(AddApplicationItem); + EditApplicationItemCommand = new RelayCommand(EditApplicationItem); + + AddIndustrySectorItemCommand = new RelayCommand(AddIndustrySectorItem); + EditIndustrySectorItemCommand = new RelayCommand(EditIndustrySectorItem); + + AddMaterialItemCommand = new RelayCommand(AddMaterialItem); + EditMaterialItemCommand = new RelayCommand(EditMaterialItem); + + AddYarnTypeItemCommand = new RelayCommand(AddYarnTypeItem); + EditYarnTypeItemCommand = new RelayCommand(EditYarnTypeItem); + + AddSubFamilyItemCommand = new RelayCommand(AddSubFamilyItem); + EditSubFamilyItemCommand = new RelayCommand(EditSubFamilyItem); + + AddFamilyItemCommand = new RelayCommand(AddFamilyItem); + EditFamilyItemCommand = new RelayCommand(EditFamilyItem); + + AddGroupItemCommand = new RelayCommand(AddGroupItem); + EditGroupItemCommand = new RelayCommand(EditGroupItem); + + AddTexturingItemCommand = new RelayCommand(AddTexturingItem); + EditTexturingItemCommand = new RelayCommand(EditTexturingItem); + + AddGeometryItemCommand = new RelayCommand(AddGeometryItem); + EditGeometryItemCommand = new RelayCommand(EditGeometryItem); + + AddYarnWhiteShadeItemCommand = new RelayCommand(AddYarnWhiteShadeItem); + EditYarnWhiteShadeItemCommand = new RelayCommand(EditYarnWhiteShadeItem); + + AddGlossLevelItemCommand = new RelayCommand(AddGlossLevelItem); + EditGlossLevelItemCommand = new RelayCommand(EditGlossLevelItem); + + } + public override void OnApplicationReady() { } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml index 739a2ae2c..697289604 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml @@ -300,7 +300,7 @@ </DockPanel> <DockPanel Grid.Column="1"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" HorizontalAlignment="Right"> - <Button HorizontalAlignment="Right" VerticalAlignment="Center" Height="35" Width="170" ToolTip="Apply to RML Liquid factors" Margin="0 0 20 0" > + <Button HorizontalAlignment="Right" VerticalAlignment="Center" Height="35" Width="170" ToolTip="Apply to RML Liquid factors" Margin="0 0 20 0" Command="{Binding SaveFactorsCommand}" > <TextBlock FontSize="14" >Save Factors</TextBlock> </Button> <Button HorizontalAlignment="Right" Width="170" Height="35" VerticalAlignment="Center" Command="{Binding SaveCommand}"> 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 index 88b1bbc62..01e7d7960 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ComboboxEditable.xaml @@ -9,30 +9,23 @@ 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 Kind="Pencil" Height="12" Foreground="{StaticResource BlueBrush100}" Width="12" FontWeight="UltraBold"> <materialDesign:PackIcon.LayoutTransform> - <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/> + <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.6" ScaleY="1.6"/> </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 Kind="Plus" Height="12" Foreground="{StaticResource RedBrush100}" Width="12" FontWeight="UltraBold"> <materialDesign:PackIcon.LayoutTransform> - <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/> + <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.6" ScaleY="1.6"/> </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"/> + <ComboBox DockPanel.Dock="Left" VerticalAlignment="Center" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=ItemsSource}" SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=UserControl}}" DisplayMemberPath="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DisplayMemberPath}" IsEditable="False" Margin="0 0 0 0" Width="Auto" /> </DockPanel> </Grid> 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 index e5b542f45..251241159 100644 --- 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 @@ -53,7 +53,17 @@ namespace Tango.MachineStudio.ThreadExtensions.Views + public string DisplayMemberPath + { + get { return (string)GetValue(DisplayMemberPathProperty); } + set { SetValue(DisplayMemberPathProperty, value); } + } + + public static readonly DependencyProperty DisplayMemberPathProperty = + DependencyProperty.Register("DisplayMemberPath", typeof(string), typeof(ComboboxEditable), new PropertyMetadata("")); + + public RelayCommand AddCommand { get { return (RelayCommand)GetValue(AddCommandProperty); } @@ -73,17 +83,6 @@ namespace Tango.MachineStudio.ThreadExtensions.Views // 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/MachineTestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml index a8aa173df..27bffbebb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml @@ -29,30 +29,11 @@ <DataTemplate> <StackPanel> <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"/> - <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"> - <TextBlock.Style> - <Style TargetType="TextBlock"> - <Style.Triggers> - <DataTrigger Binding="{Binding HasTestResults ,RelativeSource={RelativeSource FindAncestor, AncestorType=ContentControl}}" Value="True"> - <Setter Property="Foreground" Value="Red"/> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> - </TextBlock> + <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"/> </StackPanel> <DataTemplate.Triggers> - <DataTrigger Binding="{Binding HasRMLTest,RelativeSource={RelativeSource FindAncestor, AncestorType=ContentControl}}"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <StackPanel> - <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock> - </StackPanel> - </DataTemplate> - </Setter.Value> - </Setter> + <DataTrigger Binding="{Binding HasRMLTest}" Value="True"> + <Setter Property="TextBlock.Foreground" Value="red"/> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> 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 0f1003a63..caab8edfb 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 @@ -56,100 +56,22 @@ </Style> </controls:TableGrid.Resources> <TextBlock Text="Manufacturer:" VerticalAlignment="Center" FontSize="16" Margin="0 3 0 0"></TextBlock> - <local:ComboboxEditable ItemsSource="{Binding Manufacturers}" SelectedItem="{Binding ActiveRML.Manufacturer,Mode=TwoWay}" DeleteCommand="{Binding DeleteBrandItemCommand}" AddCommand="{Binding AddManufacturerItemCommand}" EditCommand="{Binding EditManufacturerItemCommand}"/> + <local:ComboboxEditable ItemsSource="{Binding Manufacturers}" SelectedItem="{Binding ActiveRML.Manufacturer,Mode=TwoWay}" AddCommand="{Binding AddManufacturerItemCommand}" EditCommand="{Binding EditManufacturerItemCommand}"/> <TextBlock Text="Brand:" VerticalAlignment="Center" ></TextBlock> - <local:ComboboxEditable ItemsSource="{Binding Brands}" SelectedItem="{Binding ActiveRMLExtension.YarnBrand,Mode=TwoWay}" DeleteCommand="{Binding DeleteBrandItemCommand}" AddCommand="{Binding AddBrandItemCommand}" EditCommand="{Binding EditBrandItemCommand}"/> + <local:ComboboxEditable ItemsSource="{Binding Brands}" SelectedItem="{Binding ActiveRMLExtension.YarnBrand,Mode=TwoWay}" DisplayMemberPath="Name" 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> - <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>--> + <local:ComboboxEditable ItemsSource="{Binding EndUse}" SelectedItem="{Binding ActiveRML.MediaPurpose,Mode=TwoWay}" DisplayMemberPath="Name" AddCommand="{Binding AddEndUseItemCommand}" EditCommand="{Binding EditEndUseItemCommand}"/> <TextBlock Text="Applications:" ></TextBlock> - <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>--> + <local:ComboboxEditable ItemsSource="{Binding Applications}" SelectedItem="{Binding ActiveRMLExtension.YarnApplication,Mode=TwoWay}" DisplayMemberPath="Name" AddCommand="{Binding AddApplicationItemCommand}" EditCommand="{Binding EditApplicationItemCommand}"/> <TextBlock Text="Industry Sector:" ></TextBlock> - <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>--> + <local:ComboboxEditable ItemsSource="{Binding IndustrySector}" SelectedItem="{Binding ActiveRMLExtension.YarnIndustrysector}" DisplayMemberPath="Name" AddCommand="{Binding AddIndustrySectorItemCommand}" EditCommand="{Binding EditIndustrySectorItemCommand}"/> </controls:TableGrid> </DockPanel> @@ -170,40 +92,32 @@ </Style> </controls:TableGrid.Resources> <TextBlock Text="Material:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding Materials}" SelectedItem="{Binding ActiveRML.MediaMaterial}" DisplayMemberPath="Name" AddCommand="{Binding AddMaterialItemCommand}" EditCommand="{Binding EditMaterialItemCommand}"/> + <TextBlock Text="Type:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding YarnTypes}" SelectedItem="{Binding ActiveRMLExtension.YarnType}" DisplayMemberPath="Name" AddCommand="{Binding AddYarnTypeItemCommand}" EditCommand="{Binding EditYarnTypeItemCommand}"/> + <TextBlock Text="Sub family:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding SubFamilies}" SelectedItem="{Binding ActiveRMLExtension.YarnSubFamily}" DisplayMemberPath="Name" AddCommand="{Binding AddSubFamilyItemCommand}" EditCommand="{Binding EditSubFamilyItemCommand}"/> + <TextBlock Text="Family:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding Family}" SelectedItem="{Binding ActiveRMLExtension.YarnFamily}" DisplayMemberPath="Name" AddCommand="{Binding AddFamilyItemCommand}" EditCommand="{Binding EditFamilyItemCommand}"/> + <TextBlock Text="Group:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding Group}" SelectedItem="{Binding ActiveRMLExtension.YarnGroup}" DisplayMemberPath="Name" AddCommand="{Binding AddGroupItemCommand}" EditCommand="{Binding EditGroupItemCommand}"/> + <TextBlock Text="Texturing:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding Texturing}" SelectedItem="{Binding ActiveRMLExtension.YarnTexturing}" DisplayMemberPath="Name" AddCommand="{Binding AddTexturingItemCommand}" EditCommand="{Binding EditTexturingItemCommand}"/> + <TextBlock Text="Geometry:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding Geometry}" SelectedItem="{Binding ActiveRML.FiberShape}" DisplayMemberPath="Name" AddCommand="{Binding AddGeometryItemCommand}" EditCommand="{Binding EditGeometryItemCommand}"/> + <TextBlock Text="Thread Shade:" ></TextBlock> - <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>--> - + <local:ComboboxEditable ItemsSource="{Binding YarnWhiteShade}" SelectedItem="{Binding ActiveRMLExtension.YarnWhiteShade}" DisplayMemberPath="Name" AddCommand="{Binding AddYarnWhiteShadeItemCommand}" EditCommand="{Binding EditYarnWhiteShadeItemCommand}"/> + <TextBlock Text="Gloss level:" ></TextBlock> - <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>--> + <local:ComboboxEditable ItemsSource="{Binding GlossLevel}" SelectedItem="{Binding ActiveRMLExtension.YarnGlossLevel}" DisplayMemberPath="Name" AddCommand="{Binding AddGlossLevelItemCommand}" EditCommand="{Binding EditGlossLevelItemCommand}"/> + </controls:TableGrid> </DockPanel> </Grid> |
