CtrEditor/ObjetosSim/Decorativos/ucTextPlate.xaml.cs

99 lines
2.2 KiB
C#
Raw Permalink Normal View History

2024-06-04 12:33:00 -03:00
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using CommunityToolkit.Mvvm.ComponentModel;
using CtrEditor.FuncionesBase;
using Newtonsoft.Json;
2024-06-04 12:33:00 -03:00
namespace CtrEditor.ObjetosSim
{
/// <summary>
/// Interaction logic for ucTextPlate.xaml
/// </summary>
///
public partial class osTextPlate : osBase, IosBase
{
[JsonIgnore]
public float offsetY;
[JsonIgnore]
public float offsetX;
2024-06-04 12:33:00 -03:00
public static string NombreClase()
{
return "Plate";
}
private string nombre = NombreClase();
public override string Nombre
{
get => nombre;
set => SetProperty(ref nombre, value);
}
[ObservableProperty]
Color color;
[ObservableProperty]
Color color_Titulo;
[ObservableProperty]
string titulo;
[ObservableProperty]
public float alto_Titulo;
public override void TopChanging(float oldValue, float newValue) {
offsetY = newValue - oldValue;
2024-06-04 12:33:00 -03:00
}
public override void LeftChanging(float oldValue, float newValue)
2024-06-04 12:33:00 -03:00
{
offsetX = newValue - oldValue;
2024-06-04 12:33:00 -03:00
}
public osTextPlate()
{
Ancho = 0.5f;
Alto = 0.5f;
Alto_Titulo = 0.2f;
Color = Colors.Gray;
Titulo = "Titulo";
}
public override void ucUnLoaded()
{
// El UserControl se esta eliminando
// eliminar el objeto de simulacion
}
}
public partial class ucTextPlate : UserControl, IDataContainer
{
public osBase? Datos { get; set; }
public ucTextPlate()
{
InitializeComponent();
this.Loaded += OnLoaded;
this.Unloaded += OnUnloaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
Datos?.ucLoaded();
}
private void OnUnloaded(object sender, RoutedEventArgs e)
{
Datos?.ucUnLoaded();
}
public void Highlight(bool State) { }
public ZIndexEnum ZIndex()
2024-06-04 12:33:00 -03:00
{
return ZIndexEnum.Decorativos;
2024-06-04 12:33:00 -03:00
}
}
}