2024-06-04 12:33:00 -03:00
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
2024-06-30 13:17:44 -03:00
|
|
|
|
using CtrEditor.FuncionesBase;
|
2024-06-09 12:33:09 -03:00
|
|
|
|
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
|
|
|
|
|
{
|
2024-06-09 12:33:09 -03:00
|
|
|
|
[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) {
|
2024-06-09 12:33:09 -03:00
|
|
|
|
offsetY = newValue - oldValue;
|
2024-06-04 12:33:00 -03:00
|
|
|
|
}
|
2024-06-09 05:39:31 -03:00
|
|
|
|
public override void LeftChanging(float oldValue, float newValue)
|
2024-06-04 12:33:00 -03:00
|
|
|
|
{
|
2024-06-09 12:33:09 -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) { }
|
2024-06-30 13:17:44 -03:00
|
|
|
|
public ZIndexEnum ZIndex()
|
2024-06-04 12:33:00 -03:00
|
|
|
|
{
|
2024-06-30 13:17:44 -03:00
|
|
|
|
return ZIndexEnum.Decorativos;
|
2024-06-04 12:33:00 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|