DB integration added, multiple images for equipment

This commit is contained in:
retr0volkov
2025-07-15 11:14:28 +03:00 Unverified
parent 7a34fc2dbb
commit 8ddce4005f
38 changed files with 627 additions and 297 deletions
+11 -10
View File
@@ -8,6 +8,8 @@ namespace GazpromApp.ViewModels;
public partial class PropertyViewModel : ViewModelBase
{
private Property Property { get; }
[ObservableProperty]
private string _name;
@@ -18,22 +20,18 @@ public partial class PropertyViewModel : ViewModelBase
// Visual and other properties
public PropertyViewModel? Parent { get; set; }
public PropertyViewModel? Parent { get; init; }
[ObservableProperty]
private bool _isEditing;
public Property GetProperty(Property? parent = null)
{
var p = new Property
{
Name = Name,
Value = Value,
Properties = [],
Parent = parent
};
p.Properties = Properties.Select(e => e.GetProperty(p)).ToList();
return p;
Property.Name = Name;
Property.Value = Value;
Property.Parent = parent;
Property.Properties = Properties.Select(e => e.GetProperty(Property)).ToList();
return Property;
}
public PropertyViewModel()
@@ -42,6 +40,7 @@ public partial class PropertyViewModel : ViewModelBase
Value = "Значение свойства";
Properties = [];
Parent = null;
Property = new Property();
}
public PropertyViewModel(Property property, PropertyViewModel? parent = null)
@@ -51,6 +50,7 @@ public partial class PropertyViewModel : ViewModelBase
Properties = new ObservableCollection<PropertyViewModel>(
property.Properties.Select(e => new PropertyViewModel(e, this)));
Parent = property.Parent is null ? null : parent;
Property = property;
}
public PropertyViewModel(PropertyViewModel property)
@@ -59,5 +59,6 @@ public partial class PropertyViewModel : ViewModelBase
Value = "Значение свойства";
Properties = [];
Parent = property;
Property = new Property();
}
}