Files
GazpromApp/ViewModels/Basic/ImageViewModel.cs
T
2025-06-30 20:13:36 +03:00

38 lines
886 B
C#

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<Point>? _points;
[ObservableProperty]
private List<Equipment>? _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 ?? [],
};
}
}