52 lines
1.2 KiB
C#
52 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using GazpromApp.Models;
|
|
|
|
namespace GazpromApp.ViewModels;
|
|
|
|
public partial class PointViewModel : ViewModelBase
|
|
{
|
|
private Point Point { get; }
|
|
|
|
[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(Point point)
|
|
{
|
|
Point = point;
|
|
Name = point.Name;
|
|
Description = point.Description;
|
|
Latitude = point.Latitude;
|
|
Longitude = point.Longitude;
|
|
Images = point.Images;
|
|
Equipment = point.Equipment;
|
|
Properties = point.Properties;
|
|
}
|
|
|
|
public Point GetPoint()
|
|
{
|
|
Point.Name = Name;
|
|
Point.Description = Description;
|
|
Point.Equipment = Equipment;
|
|
Point.Images = Images;
|
|
Point.Properties = Properties;
|
|
return Point;
|
|
}
|
|
} |