using System; using System.Collections.Generic; using System.Runtime.InteropServices.JavaScript; using Avalonia.Media.Imaging; using CommunityToolkit.Mvvm.ComponentModel; using GazpromApp.Models; namespace GazpromApp.ViewModels; public partial class ImageViewModel : ViewModelBase { [ObservableProperty] private byte[]? _bytes; // EF stuff [ObservableProperty] private List? _points; [ObservableProperty] private List? _equipment; [ObservableProperty] private Bitmap? _fileName; public ImageViewModel(Image image) { Bytes = image.Bytes; Equipment = image.Equipment; Points = image.Points; } public Image GetImage() { return new Image() { Bytes = Bytes ?? [], Equipment = Equipment ?? [], Points = Points ?? [], }; } }