3using System.Threading.Tasks;
4using System.Windows.Input;
18 private readonly
Command removePart;
20 private readonly
Part part;
34 this.partsModel = PartsModel;
39 if (this.partsModel is not
null)
40 this.partsModel.PropertyChanged += this.DesignModel_PropertyChanged;
53 get => this.legalId.Value;
56 this.part.LegalId = value;
57 this.legalId.Value = value;
66 get => this.role.Value;
69 this.part.Role = value;
70 this.role.Value = value;
77 public string[]
Roles => this.partsModel.RoleNames;
79 private void DesignModel_PropertyChanged(
object sender, System.ComponentModel.PropertyChangedEventArgs e)
81 if (e.PropertyName == nameof(this.Roles))
96 return this.partsModel is not
null;
104 if (this.partsModel is not
null)
106 this.partsModel.PropertyChanged -= this.DesignModel_PropertyChanged;
107 this.partsModel.RemovePart(
this);
110 return Task.CompletedTask;
Defines a custom command.
Abstract base class for ordered items
Contains information about a part in the contract
Part Part
Part reference object.
ICommand RemovePart
Remove part command
Task ExecuteRemovePart()
Removes the part.
PartInfo(Part Part, IPartsModel PartsModel, Property< PartInfo[]> Parts)
Contains information about a part in the contract
bool CanExecuteRemovePart()
If the remove part command can be exeucted.
virtual void RaisePropertyChanged(string PropertyName)
Raises the PropertyChanged event.
Generic class for properties
Class defining a part in a contract
string LegalId
Legal identity of part
string Role
Role of the part in the contract
Interface for models allowing editing of parts