Refactoring WIP
This commit is contained in:
30
Infrastructure/UI/DataContexts/Ellipse.cs
Normal file
30
Infrastructure/UI/DataContexts/Ellipse.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using StructureHelper.Infrastructure.Enums;
|
||||
using StructureHelper.Windows.MainWindow;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
public class Ellipse : PrimitiveBase
|
||||
{
|
||||
private double square;
|
||||
public double Square
|
||||
{
|
||||
get => square;
|
||||
set
|
||||
{
|
||||
square = value;
|
||||
PrimitiveWidth = Math.Round(Math.Sqrt(4 * value / Math.PI), 2);
|
||||
OnPropertyChanged(nameof(PrimitiveWidth));
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Ellipse(double square, double ellipseX, double ellipseY, MainViewModel mainViewModel) : base(PrimitiveType.Ellipse, ellipseX, ellipseY, mainViewModel)
|
||||
{
|
||||
Square = square;
|
||||
ShowedX = 0;
|
||||
ShowedY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user