Primitive View Logic for Main View modael was added

This commit is contained in:
Evgeny Redikultsev
2023-01-04 18:43:11 +05:00
parent 913d31e04f
commit 2d7c8648ab
24 changed files with 557 additions and 341 deletions

View File

@@ -0,0 +1,42 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using StructureHelperCommon.Services.ColorServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
public class VisualProperty : IVisualProperty
{
public bool IsVisible { get; set; }
public Color Color { get; set; }
public bool SetMaterialColor { get; set; }
public int ZIndex { get; set; }
private double opacity;
public double Opacity
{
get { return opacity; }
set
{
if (value < 0d || value > 1d) { throw new StructureHelperException(ErrorStrings.VisualPropertyIsNotRight + nameof(Opacity) + value); }
opacity = value;
}
}
public VisualProperty()
{
IsVisible = true;
Color = ColorProcessor.GetRandomColor();
SetMaterialColor = true;
ZIndex = 0;
Opacity = 1;
}
}
}