Adding point works
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using GazpromApp.Models;
|
||||
|
||||
namespace GazpromApp.ViewModels;
|
||||
|
||||
public partial class PointViewModel : ViewModelBase
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string? _name;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _description;
|
||||
|
||||
[ObservableProperty]
|
||||
private double? _latitude;
|
||||
|
||||
[ObservableProperty]
|
||||
private double? _longitude;
|
||||
// EF stuff
|
||||
[ObservableProperty]
|
||||
private List<Image>? _images;
|
||||
[ObservableProperty]
|
||||
private List<Equipment>? _equipment;
|
||||
[ObservableProperty]
|
||||
private List<Property>? _properties;
|
||||
|
||||
public PointViewModel(Models.Point point)
|
||||
{
|
||||
Name = point.Name;
|
||||
Description = point.Description;
|
||||
Latitude = point.Latitude;
|
||||
Longitude = point.Longitude;
|
||||
Images = point.Images;
|
||||
Equipment = point.Equipment;
|
||||
Properties = point.Properties;
|
||||
}
|
||||
|
||||
public Models.Point GetPoint()
|
||||
{
|
||||
return new Models.Point()
|
||||
{
|
||||
Name = this.Name,
|
||||
Description = this.Description
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user