diff --git a/VECTO3GUI/Model/AlternatorTechnologyModel.cs b/VECTO3GUI/Model/AlternatorTechnologyModel.cs index 76c80e7b2a4e2edee47780150bdb6c062534275a..6b5c7fd5db2c8886c7925260cf12f9bfd5828d6b 100644 --- a/VECTO3GUI/Model/AlternatorTechnologyModel.cs +++ b/VECTO3GUI/Model/AlternatorTechnologyModel.cs @@ -1,42 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.Remoting.Channels; using System.Text; using System.Threading.Tasks; using VECTO3GUI.ViewModel.Impl; namespace VECTO3GUI.Model { - //public enum AlternatorTechnology - //{ - // Empty, - // Default - //} - - //public static class AlternatorTechnologyHelper - //{ - // public static string GetLabel(this AlternatorTechnology technology) - // { - // switch (technology) { - // case AlternatorTechnology.Default: - // return nameof(AlternatorTechnology.Default).ToLower(); - // default: - // return string.Empty; - // } - // } - - // public static AlternatorTechnology Parse(string technologyName) - // { - // switch (technologyName.ToLower()) { - // case "default": - // return AlternatorTechnology.Default; - // default: - // return AlternatorTechnology.Empty; - // } - // } - //} - public class AlternatorTechnologyModel : ObservableObject { public string _alternatorTechnology; diff --git a/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs b/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs index b92fd10401b96a5629c1e1c790eea708d5476076..e4a97e78939cd5a9905e0888af9bd68cf2dd551f 100644 --- a/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs +++ b/VECTO3GUI/Model/TempDataObject/AirdragComponentData.cs @@ -17,16 +17,17 @@ namespace VECTO3GUI.Model.TempDataObject public string Model { get; set; } public string CertificationNumber { get; set; } public DateTime? Date { get; set; } - public bool NoAirdragData { get; set; } public bool UseMeasuredValues { get; set; } public SquareMeter CdxA_0 { get; set; } public SquareMeter TransferredCdxA { get; set; } public SquareMeter DeclaredCdxA { get; set; } public string AppVersion { get; set; } - public DigestData DigestValue { get; set; } + public bool NoAirdragData { get; set; } + public bool UseMeasurementData { get; set; } #endregion + public AirdragComponentData(){} @@ -34,6 +35,8 @@ namespace VECTO3GUI.Model.TempDataObject { if(defaultValues) ClearValues(viewModel); + UseMeasurementData = viewModel.UseMeasurementData; + NoAirdragData = viewModel.NoAirdragData; } public AirdragComponentData(IAirdragViewModel airdrag) @@ -48,6 +51,7 @@ namespace VECTO3GUI.Model.TempDataObject public void ResetToComponentValues(IAirdragViewModel viewModel) { + viewModel.UseMeasurementData = UseMeasurementData; viewModel.NoAirdragData = NoAirdragData; viewModel.Model = Model; viewModel.Manufacturer = Manufacturer; @@ -75,6 +79,7 @@ namespace VECTO3GUI.Model.TempDataObject private void SetValues(IAirdragViewModel viewModel) { + UseMeasurementData = viewModel.UseMeasurementData; NoAirdragData = viewModel.NoAirdragData; Model = viewModel.Model; Manufacturer = viewModel.Manufacturer; diff --git a/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs b/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs index 97798264387c6f70a022e58a0b7603105c9b714a..19d97240d727d6507d8c3ec832a10db1a09f01f9 100644 --- a/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs +++ b/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs @@ -42,6 +42,8 @@ namespace VECTO3GUI.Model.TempDataObject AlternatorTechnologies = new ObservableCollectionEx<AlternatorTechnologyModel>(); if (defaultValues) ClearValues(viewModel); + + OriginAlternatorTechnologies = new List<AlternatorTechnologyModel>(); SetXmlNamesToPropertyMapping(); } @@ -73,25 +75,22 @@ namespace VECTO3GUI.Model.TempDataObject viewModel.HeatPump = HeatPump; viewModel.AdjustableAuxiliaryHeater = AdjustableAuxiliaryHeater; viewModel.SeparateAirDistributionDucts = SeparateAirDistributionDucts; - } private void SetAlternatorTechnology(ObservableCollectionEx<AlternatorTechnologyModel> res) { if (OriginAlternatorTechnologies == null) return; - //var res = new ObservableCollectionEx<AlternatorTechnologyModel>(); + res.Clear(); for (int i = 0; i < OriginAlternatorTechnologies.Count; i++) { res.Add(new AlternatorTechnologyModel{AlternatorTechnology = OriginAlternatorTechnologies[i].AlternatorTechnology}); } - - //return res; } public void ClearValues(IAuxiliariesViewModel viewModel) { - viewModel.AlternatorTechnologies.Clear(); // = default(ObservableCollectionEx<AlternatorTechnologyModel>); + viewModel.AlternatorTechnologies.Clear(); viewModel.DayrunninglightsLED = default(bool); viewModel.HeadlightsLED = default(bool); viewModel.PositionlightsLED = default(bool); @@ -124,7 +123,6 @@ namespace VECTO3GUI.Model.TempDataObject HeatPump = auxiliaries.HeatPump; AdjustableAuxiliaryHeater = auxiliaries.AdjustableAuxiliaryHeater; SeparateAirDistributionDucts = auxiliaries.SeparateAirDistributionDucts; - } private List<AlternatorTechnologyModel> GetOriginAlternatorTechnologies(IAuxiliariesViewModel auxiliaries) diff --git a/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs b/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs index 10e435154f93dbe29873c2de5e6247433d6bf2b3..a0841b1c2bf0d01bfb12a7b5967412c6b711fc17 100644 --- a/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs @@ -23,8 +23,19 @@ namespace VECTO3GUI.ViewModel.Impl private ICommand _saveJobCommand; private ICommand _closeJobCommand; private ICommand _saveAsJobCommand; + private Component _selectedComponent; - + public Component SelectedComponent + { + get { return _selectedComponent; } + set + { + if (SetProperty(ref _selectedComponent, value)) { + DoEditComponent(_selectedComponent); + } + } + } + protected string XmlFilePath { get; private set; } protected bool IsNewJob { get; set; } @@ -87,6 +98,17 @@ namespace VECTO3GUI.ViewModel.Impl protected virtual void DoEditComponent(Component component) { var nextView = GetComponentViewModel(component); + + if (CurrentComponent is AuxiliariesViewModel) { + var convert = CurrentComponent as AuxiliariesViewModel; + convert?.CacheAlternatorTechnologies(); + } + + if (nextView is AuxiliariesViewModel) { + var convert = nextView as AuxiliariesViewModel; + convert.LoadCachedAlternatorTechnologies(); + } + CurrentComponent = nextView ?? Kernel.Get<INoneViewModel>(); } diff --git a/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs b/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs index 38ac0596e0571b5c1d994a86cc4cb5572271b079..3b44688adde6bfcc4b3846cb01caae491a297883 100644 --- a/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs @@ -148,7 +148,7 @@ namespace VECTO3GUI.ViewModel.Impl get { return _appVersion; } set { - if (SetProperty(ref _appVersion, value)) + if (!SetProperty(ref _appVersion, value)) return; IsDataChanged(_appVersion, _componentData); } @@ -162,9 +162,9 @@ namespace VECTO3GUI.ViewModel.Impl get { return _noAirdragData; } set { - SetProperty(ref _noAirdragData, value); + if(!SetProperty(ref _noAirdragData, value)) + return; IsDataChanged(_noAirdragData, _componentData); - UseMeasurementData = !_noAirdragData; } } @@ -179,10 +179,15 @@ namespace VECTO3GUI.ViewModel.Impl public bool UseMeasurementData { get { return _useMeasurementData; } - set { SetProperty(ref _useMeasurementData, value); } + set + { + if (!SetProperty(ref _useMeasurementData, value)) + return; + IsDataChanged(_useMeasurementData, _componentData); + } } - + protected override void InputDataChanged() { var inputData = JobViewModel.InputDataProvider as IDeclarationInputDataProvider; @@ -191,30 +196,33 @@ namespace VECTO3GUI.ViewModel.Impl _xmlFilePath = XmlHelper.GetXmlAbsoluteFilePath(xmlUri); SetAirdragValues(_airdragData); - UseMeasurementData = _airdragData?.AirDragArea != null; - NoAirdragData = !UseMeasurementData; IsEditable = false; } private void SetAirdragValues(IAirdragDeclarationInputData airdrag) { UseMeasuredValues = airdrag?.AirDragArea != null; + UseMeasurementData = _airdragData?.AirDragArea != null; + NoAirdragData = !UseMeasurementData; + if (airdrag?.AirDragArea == null) { _componentData = new AirdragComponentData(this, true); - return; + } + else + { + Model = airdrag.Model; + Manufacturer = airdrag.Manufacturer; + CertificationNumber = airdrag.CertificationNumber; + Date = airdrag.Date; + AppVersion = airdrag.AppVersion; + DeclaredCdxA = airdrag.AirDragArea; + DigestValue = airdrag.DigestValue; + ReadAdditionalAirdragValues(); + + _componentData = new AirdragComponentData(this); } - Model = airdrag.Model; - Manufacturer = airdrag.Manufacturer; - CertificationNumber = airdrag.CertificationNumber; - Date = airdrag.Date; - AppVersion = airdrag.AppVersion; - DeclaredCdxA = airdrag.AirDragArea; - DigestValue = airdrag.DigestValue; - ReadAdditionalAirdragValues(); - - _componentData = new AirdragComponentData(this); ClearChangedProperties(); } @@ -239,7 +247,8 @@ namespace VECTO3GUI.ViewModel.Impl private void DoAirdragConfig(AirdragConfig config) { - switch (config) { + switch (config) + { case AirdragConfig.UseDefaultAirdragData: NoAirdragData = true; break; diff --git a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs index 9107544e13a4b2ab8e030fdc6fb26f27cb77c22a..d0fd27ff2da80323bf09f94fecf82e04a7ae5bba 100644 --- a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs @@ -19,9 +19,6 @@ using VECTO3GUI.Model.TempDataObject; namespace VECTO3GUI.ViewModel.Impl { - - - public class AuxiliariesViewModel : AbstractComponentViewModel, IAuxiliariesViewModel { #region Members @@ -34,7 +31,7 @@ namespace VECTO3GUI.ViewModel.Impl private IAxlesViewModel axlesViewModel; private IBusAuxiliariesDeclarationData _busAuxiliaries; - + private ObservableCollectionEx<AlternatorTechnologyModel> _alternatorTechnologies = new ObservableCollectionEx<AlternatorTechnologyModel>(); private bool _dayRunningLightsLED; private bool _headlightyLED; @@ -288,15 +285,17 @@ namespace VECTO3GUI.ViewModel.Impl public Dictionary<string, string> XmlNamesToPropertyMapping { get; private set; } - public ConsumerTechnology DoorDriveTechnology { get; set; } - + public AllowedEntry<BusHVACSystemConfiguration>[] AllowedSystemConfigurations { get; private set; } public AllowedEntry<ACCompressorType>[] AllowedDriverACCompressorTypes { get; private set; } public AllowedEntry<ACCompressorType>[] AllowedPassengerACCompressorTypes { get; private set; } public AllowedEntry<string>[] AllowedAlternatorTechnology { get; private set; } + + #endregion + private List<AlternatorTechnologyModel> _cachedAlternators { get; set; } protected override void InputDataChanged() { @@ -323,39 +322,41 @@ namespace VECTO3GUI.ViewModel.Impl if (busAux == null) { _componentData = new AuxiliariesBusComponentData(this, true); - return; + AlternatorTechnologies.CollectionChanged += AlternatorTechnologiesOnCollectionChanged; + AlternatorTechnologies.CollectionItemChanged += AlternatorTechnologiesOnCollectionItemChanged; } - - if (!busAux.ElectricSupply.Alternators.IsNullOrEmpty()) + else { + if (!busAux.ElectricSupply.Alternators.IsNullOrEmpty()) + { + AlternatorTechnologies.Clear(); - AlternatorTechnologies.Clear(); // = new ObservableCollectionEx<AlternatorTechnologyModel>(); - - AlternatorTechnologies.CollectionChanged += AlternatorTechnologiesOnCollectionChanged; - AlternatorTechnologies.CollectionItemChanged += AlternatorTechnologiesOnCollectionItemChanged; + AlternatorTechnologies.CollectionChanged += AlternatorTechnologiesOnCollectionChanged; + AlternatorTechnologies.CollectionItemChanged += AlternatorTechnologiesOnCollectionItemChanged; - for (int i = 0; i < busAux.ElectricSupply.Alternators.Count; i++) - { - AlternatorTechnologies.Add(new AlternatorTechnologyModel(){ AlternatorTechnology = busAux.ElectricSupply.Alternators[i].Technology }); + for (int i = 0; i < busAux.ElectricSupply.Alternators.Count; i++) + { + AlternatorTechnologies.Add(new AlternatorTechnologyModel() { AlternatorTechnology = busAux.ElectricSupply.Alternators[i].Technology }); + } } + + DayrunninglightsLED = busAux.ElectricConsumers.DayrunninglightsLED; + HeadlightsLED = busAux.ElectricConsumers.HeadlightsLED; + PositionlightsLED = busAux.ElectricConsumers.PositionlightsLED; + BrakelightsLED = busAux.ElectricConsumers.BrakelightsLED; + InteriorLightsLED = busAux.ElectricConsumers.InteriorLightsLED; + SystemConfiguration = busAux.HVACAux.SystemConfiguration; + CompressorTypeDriver = busAux.HVACAux.CompressorTypeDriver; + CompressorTypePassenger = busAux.HVACAux.CompressorTypePassenger; + AuxHeaterPower = busAux.HVACAux.AuxHeaterPower; + DoubleGlasing = busAux.HVACAux.DoubleGlasing; + HeatPump = busAux.HVACAux.HeatPump; + AdjustableAuxiliaryHeater = busAux.HVACAux.AdjustableAuxiliaryHeater; + SeparateAirDistributionDucts = busAux.HVACAux.SeparateAirDistributionDucts; + + _componentData = new AuxiliariesBusComponentData(this); } - DayrunninglightsLED = busAux.ElectricConsumers.DayrunninglightsLED; - HeadlightsLED = busAux.ElectricConsumers.HeadlightsLED; - PositionlightsLED = busAux.ElectricConsumers.PositionlightsLED; - BrakelightsLED = busAux.ElectricConsumers.BrakelightsLED; - InteriorLightsLED = busAux.ElectricConsumers.InteriorLightsLED; - SystemConfiguration = busAux.HVACAux.SystemConfiguration; - CompressorTypeDriver = busAux.HVACAux.CompressorTypeDriver; - CompressorTypePassenger = busAux.HVACAux.CompressorTypePassenger; - AuxHeaterPower = busAux.HVACAux.AuxHeaterPower; - DoubleGlasing = busAux.HVACAux.DoubleGlasing; - HeatPump = busAux.HVACAux.HeatPump; - AdjustableAuxiliaryHeater = busAux.HVACAux.AdjustableAuxiliaryHeater; - SeparateAirDistributionDucts = busAux.HVACAux.SeparateAirDistributionDucts; - DoorDriveTechnology = ConsumerTechnology.Pneumatically; - - _componentData = new AuxiliariesBusComponentData(this); ClearChangedProperties(); } @@ -418,6 +419,31 @@ namespace VECTO3GUI.ViewModel.Impl SetChangedProperty(changed, nameof(AlternatorTechnologies)); } + public void CacheAlternatorTechnologies() + { + if (_componentData != null) + { + _cachedAlternators = new List<AlternatorTechnologyModel>(); + for (int i = 0; i < AlternatorTechnologies.Count; i++) + { + _cachedAlternators.Add(new AlternatorTechnologyModel { AlternatorTechnology = AlternatorTechnologies[i].AlternatorTechnology }); + } + } + } + + public void LoadCachedAlternatorTechnologies() + { + if (_componentData != null && _cachedAlternators != null) + { + AlternatorTechnologies.Clear(); + for (int i = 0; i < _cachedAlternators.Count; i++) + { + AlternatorTechnologies.Add(new AlternatorTechnologyModel { AlternatorTechnology = _cachedAlternators[i].AlternatorTechnology }); + } + } + } + + public override object CommitComponentData() { _componentData.UpdateCurrentValues(this); @@ -448,7 +474,7 @@ namespace VECTO3GUI.ViewModel.Impl RemovePropertyError(propertyName); } } - + #region Commands @@ -492,15 +518,9 @@ namespace VECTO3GUI.ViewModel.Impl private void DoAddAlternator() { - if (AlternatorTechnologies == null) { - AlternatorTechnologies = new ObservableCollectionEx<AlternatorTechnologyModel>(); - AlternatorTechnologies.CollectionChanged += AlternatorTechnologiesOnCollectionChanged; - AlternatorTechnologies.CollectionItemChanged += AlternatorTechnologiesOnCollectionItemChanged; - } - AlternatorTechnologies.Add(new AlternatorTechnologyModel { - AlternatorTechnology = string.Empty + AlternatorTechnology = null }); } diff --git a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs index 10ef4b11db7e46a9abe1b39431ae91f50831d4b8..45356d4acd19cf89251d125667a862152b9a6cf7 100644 --- a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs @@ -116,8 +116,9 @@ namespace VECTO3GUI.ViewModel.Impl if (XmlHelper.ValidateXDocument(xDoc, null, ValidationErrorAction)) { _xmlCompletedBusWriter.WriteCompletedBusXml(XmlFilePath, xDoc); CloseWindow(window); + } else { + ValidationResultDialogWindow(false); } - ValidationResultDialogWindow(false); } } @@ -143,8 +144,9 @@ namespace VECTO3GUI.ViewModel.Impl { _xmlCompletedBusWriter.WriteCompletedBusXml(filePath, xDocument); CloseWindow(window); + } else { + ValidationResultDialogWindow(false); } - ValidationResultDialogWindow(false); } public ICommand CommitComponent diff --git a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs index e8868d78bab5f6faf2b09ae75277dd2d4550dbe3..31a15bec324cea09ece2bf4cae57ba3eddc2e29d 100644 --- a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs @@ -234,7 +234,6 @@ namespace VECTO3GUI.ViewModel.Impl { if (!SetProperty(ref _doorDriveTechnology, value)) return; - IsDataChanged(_doorDriveTechnology, _componentData); } } @@ -267,30 +266,31 @@ namespace VECTO3GUI.ViewModel.Impl if (vehicle == null) { _componentData = new VehicleBusComponentData(this, true); - return; + } + else + { + Manufacturer = vehicle.Manufacturer; + ManufacturerAddress = vehicle.ManufacturerAddress; + Model = vehicle.Model; + VIN = vehicle.VIN; + Date = vehicle.Date; + LegislativeClass = vehicle.LegislativeClass; + RegisteredClass = vehicle.RegisteredClass; + VehicleCode = vehicle.VehicleCode; + CurbMassChassis = vehicle.CurbMassChassis; + TechnicalPermissibleMaximumLadenMass = vehicle.GrossVehicleMassRating; + NgTankSystem = vehicle.TankSystem; + NumberOfPassengersLowerDeck = vehicle.NumberOfPassengersLowerDeck; + NumberOfPassengersUpperDeck = vehicle.NumberOfPassengersUpperDeck; + LowEntry = vehicle.FloorType == FloorType.LowFloor; + HeightIntegratedBody = vehicle.Height; + VehicleLength = vehicle.Length; + VehicleWidth = vehicle.Width; + EntranceHeight = vehicle.EntranceHeight; + DoorDriveTechnology = vehicle.DoorDriveTechnology; + _componentData = new VehicleBusComponentData(this); } - Manufacturer = vehicle.Manufacturer; - ManufacturerAddress = vehicle.ManufacturerAddress; - Model = vehicle.Model; - VIN = vehicle.VIN; - Date = vehicle.Date; - LegislativeClass = vehicle.LegislativeClass; - RegisteredClass = vehicle.RegisteredClass; - VehicleCode = vehicle.VehicleCode; - CurbMassChassis = vehicle.CurbMassChassis; - TechnicalPermissibleMaximumLadenMass = vehicle.GrossVehicleMassRating; - NgTankSystem = vehicle.TankSystem; - NumberOfPassengersLowerDeck = vehicle.NumberOfPassengersLowerDeck; - NumberOfPassengersUpperDeck = vehicle.NumberOfPassengersUpperDeck; - LowEntry = vehicle.FloorType == FloorType.LowFloor; - HeightIntegratedBody = vehicle.Height; - VehicleLength = vehicle.Length; - VehicleWidth = vehicle.Width; - EntranceHeight = vehicle.EntranceHeight; - DoorDriveTechnology = vehicle.DoorDriveTechnology; - - _componentData = new VehicleBusComponentData(this); ClearChangedProperties(); } diff --git a/VECTO3GUI/ViewModel/Interfaces/IAirdrag.cs b/VECTO3GUI/ViewModel/Interfaces/IAirdrag.cs index aa59c689eef35fd1513f53adddac63f8b403e180..ce647bd92bf889d330fcc9349483a9fea7182c45 100644 --- a/VECTO3GUI/ViewModel/Interfaces/IAirdrag.cs +++ b/VECTO3GUI/ViewModel/Interfaces/IAirdrag.cs @@ -11,6 +11,7 @@ namespace VECTO3GUI.ViewModel.Interfaces public interface IAirdrag : ICommonComponentParameters { bool NoAirdragData { get; set; } + bool UseMeasurementData { get; set; } bool UseMeasuredValues { get; set; } SquareMeter CdxA_0 { get; set; } SquareMeter TransferredCdxA { get; set; } diff --git a/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs index 3bfe460225a825cefba20807d424dc66caa5458a..c018b15fb8859a4e261629e4199e339420a317be 100644 --- a/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs +++ b/VECTO3GUI/ViewModel/Interfaces/IAirdragViewModel.cs @@ -8,9 +8,6 @@ namespace VECTO3GUI.ViewModel.Interfaces { IAirdragDeclarationInputData ModelData { get; } bool IsEditable { get; } - - bool UseMeasurementData { get; } - ICommand LoadFileCommand { get; } ICommand AirdragConfigCommand { get; } diff --git a/VECTO3GUI/ViewModel/Interfaces/IJobEditViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/IJobEditViewModel.cs index e4d4e1af06b5fbb05af8618f9e0d985f9427a6f5..b07b8aa5e73f2fe685b5ed835fbf3eb91feba10c 100644 --- a/VECTO3GUI/ViewModel/Interfaces/IJobEditViewModel.cs +++ b/VECTO3GUI/ViewModel/Interfaces/IJobEditViewModel.cs @@ -15,6 +15,7 @@ namespace VECTO3GUI.ViewModel.Interfaces bool DeclarationMode { get; } ObservableCollection<Component> Components { get; } ICommand EditComponent { get; } + Component SelectedComponent { get; } IComponentViewModel CurrentComponent { get; } ICommand SaveJob { get; } diff --git a/VECTO3GUI/Views/JoblistTabView.xaml b/VECTO3GUI/Views/JoblistTabView.xaml index ed537a0fe8f472c39ad3f55904b8298733f8a138..74796978e57ae514c67804e37f202fa81dfb0fae 100644 --- a/VECTO3GUI/Views/JoblistTabView.xaml +++ b/VECTO3GUI/Views/JoblistTabView.xaml @@ -62,16 +62,7 @@ <Grid Grid.Column="1"> - <TabControl TabStripPlacement="Top" ItemsSource="{Binding Components}" x:Name="ComponentsTab" SelectedIndex="0"> - - <i:Interaction.Triggers> - <i:EventTrigger EventName="SelectionChanged"> - <i:InvokeCommandAction - Command="{Binding EditComponent}" - CommandParameter="{Binding ElementName=ComponentsTab, Path=SelectedItem}"> - </i:InvokeCommandAction> - </i:EventTrigger> - </i:Interaction.Triggers> + <TabControl TabStripPlacement="Top" ItemsSource="{Binding Components}" x:Name="ComponentsTab" SelectedIndex="0" SelectedItem="{Binding SelectedComponent}"> <TabControl.ItemTemplate> <DataTemplate>