using System.Windows; using System.Windows.Controls; using System.Windows.Media; using CommunityToolkit.Mvvm.ComponentModel; using Newtonsoft.Json; namespace CtrEditor.ObjetosSim { /// /// Interaction logic for ucTextPlate.xaml /// /// public partial class osTextPlate : osBase, IosBase { [JsonIgnore] public float offsetY; [JsonIgnore] public float offsetX; 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; } public override void LeftChanging(float oldValue, float newValue) { offsetX = newValue - oldValue; } 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 int ZIndex() { return 1; } } }