38 lines
954 B
C#
38 lines
954 B
C#
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Markup.Xaml;
|
|
using MIES_System.Models;
|
|
using MIES_System.ViewModels;
|
|
|
|
namespace MIES_System.Views;
|
|
|
|
public partial class ExpedienteView : UserControl
|
|
{
|
|
public ExpedienteView()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Editar(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is Button button && button.DataContext is ExpedienteModel nino)
|
|
{
|
|
if (DataContext is ExpedienteViewModel viewModel)
|
|
{
|
|
viewModel.EditarCommand.Execute(nino);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Eliminar(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is Button button && button.DataContext is ExpedienteModel nino)
|
|
{
|
|
if (DataContext is ExpedienteViewModel viewModel)
|
|
{
|
|
viewModel.EliminarCommand.Execute(nino);
|
|
}
|
|
}
|
|
}
|
|
} |