Visual properies of cross section were changed

This commit is contained in:
Evgeny Redikultsev
2024-02-14 21:27:03 +05:00
parent 165a2846bb
commit d650924628
9 changed files with 438 additions and 287 deletions

View File

@@ -2,13 +2,15 @@
using StructureHelper.Services.Primitives;
using StructureHelper.Windows.MainWindow;
using StructureHelper.Windows.ViewModels.NdmCrossSections;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Windows.Input;
using System.Windows.Media;
namespace StructureHelper.Infrastructure.UI.DataContexts
{
public abstract class PrimitiveBase : ViewModelBase
public abstract class PrimitiveBase : ViewModelBase, IObserver<IRectangleShape>
{
#region Поля
private IPrimitiveRepository primitiveRepository;
@@ -236,12 +238,6 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
this.primitive = primitive;
}
public void RegisterDeltas(double dx, double dy)
{
DeltaX = dx;
DeltaY = dy;
}
public CrossSectionViewModel OwnerVM { get; private set; }
public double DeltaX { get; private set; }
@@ -253,14 +249,6 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
return primitive;
}
//public virtual void RefreshNdmPrimitive()
//{
//}
public void RefreshColor()
{
OnPropertyChanged(nameof(Color));
}
public virtual void Refresh()
{
OnPropertyChanged(nameof(Name));
@@ -273,5 +261,22 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
OnPropertyChanged(nameof(PrimitiveWidth));
OnPropertyChanged(nameof(PrimitiveHeight));
}
public void OnCompleted()
{
throw new NotImplementedException();
}
public void OnError(Exception error)
{
throw new NotImplementedException();
}
public void OnNext(IRectangleShape value)
{
DeltaX = value.Width / 2d;
DeltaY = value.Height / 2d;
Refresh();
}
}
}