mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add screen editing in admin view.
This commit is contained in:
31
Marechai/ViewModels/ScreenViewModel.cs
Normal file
31
Marechai/ViewModels/ScreenViewModel.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marechai.ViewModels
|
||||
{
|
||||
public class ScreenViewModel : BaseViewModel<int>
|
||||
{
|
||||
public double? Width { get; set; }
|
||||
public double? Height { get; set; }
|
||||
public double Diagonal { get; set; }
|
||||
public int NativeResolutionId { get; set; }
|
||||
public ResolutionViewModel NativeResolution { get; set; }
|
||||
public long? EffectiveColors { get; set; }
|
||||
public string Type { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public long? Colors => EffectiveColors ?? NativeResolution.Colors;
|
||||
|
||||
[NotMapped]
|
||||
public string Size
|
||||
{
|
||||
get
|
||||
{
|
||||
if(Width != null &&
|
||||
Height != null)
|
||||
return$"{Width}x{Height} mm";
|
||||
|
||||
return"Unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user