DB integration added, multiple images for equipment
This commit is contained in:
@@ -142,15 +142,14 @@ public partial class EditPointDialogViewModel : ViewModelBase
|
||||
private void CompleteEdit()
|
||||
{
|
||||
IsClosed = true;
|
||||
var point = new Point
|
||||
{
|
||||
Name = Name,
|
||||
Description = Description,
|
||||
Images = Images.Select(e => e.GetImage()).ToList(),
|
||||
Equipment = Equipment.Select(e => e.GetEquipment()).ToList(),
|
||||
Properties = Properties.Select(e => e.GetProperty()).ToList()
|
||||
};
|
||||
WeakReferenceMessenger.Default.Send(new EditPointDone(new PointViewModel(point)));
|
||||
_point.Name = Name;
|
||||
_point.Description = Description;
|
||||
_point.Images = Images.Select(e => e.GetImage()).ToList();
|
||||
_point.Equipment = Equipment.Select(e => e.GetEquipment()).ToList();
|
||||
_point.Properties = Properties.Select(e => e.GetProperty()).ToList();
|
||||
_ = _point.GetPoint();
|
||||
|
||||
WeakReferenceMessenger.Default.Send(new EditPointDone(new PointViewModel(_point.GetPoint())));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -182,12 +181,14 @@ public partial class EditPointDialogViewModel : ViewModelBase
|
||||
new EquipmentViewModel
|
||||
{
|
||||
Name = "Equipment Name Very Long",
|
||||
Description = "Really big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long text", Image = null
|
||||
Description = "Really big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long text",
|
||||
Images = []
|
||||
},
|
||||
new EquipmentViewModel
|
||||
{
|
||||
Name = "Equipment Name Very Long",
|
||||
Description = "Really big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long text", Image = null
|
||||
Description = "Really big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long textReally big description for the equipment to show the long text",
|
||||
Images = []
|
||||
}
|
||||
];
|
||||
Properties = [
|
||||
@@ -254,9 +255,9 @@ public partial class EditPointDialogViewModel : ViewModelBase
|
||||
{
|
||||
Name = point.Name;
|
||||
Description = point.Description;
|
||||
Images = new ObservableCollection<ImageViewModel>((point.Images ?? []).Select(e => new ImageViewModel(e)));
|
||||
Equipment = new ObservableCollection<EquipmentViewModel>((point.Equipment ?? []).Select(e => new EquipmentViewModel(e)));
|
||||
Properties = new ObservableCollection<PropertyViewModel>((point.Properties ?? []).Select(e => new PropertyViewModel(e)));
|
||||
Images = new ObservableCollection<ImageViewModel>(point.Images.Select(e => new ImageViewModel(e)));
|
||||
Equipment = new ObservableCollection<EquipmentViewModel>(point.Equipment.Select(e => new EquipmentViewModel(e)));
|
||||
Properties = new ObservableCollection<PropertyViewModel>(point.Properties.Select(e => new PropertyViewModel(e)));
|
||||
|
||||
IsImagesEmpty = Images.Count == 0;
|
||||
IsEquipmentEmpty = Equipment.Count == 0;
|
||||
|
||||
Reference in New Issue
Block a user