EditAndAddStudent.axaml.cs 860 B

12345678910111213141516171819202122232425
  1. using Avalonia.Controls;
  2. using AvaloniaApplication4.AdditionalModels;
  3. using AvaloniaApplication4.Models;
  4. using AvaloniaApplication4.ViewModels;
  5. namespace AvaloniaApplication4.Views.ActionPages
  6. {
  7. public partial class EditAndAddStudent : UserControl
  8. {
  9. public EditAndAddStudent(User? user,ref GlobalsData globalsData)
  10. {
  11. DataContext = new EditAndAddStudentViewModel(user,ref globalsData);
  12. InitializeComponent();
  13. delBtn.IsVisible = false;
  14. saveBtn.IsVisible = true;
  15. }
  16. public EditAndAddStudent(User? user,Student student, ref GlobalsData globalsData)
  17. {
  18. DataContext = new EditAndAddStudentViewModel(user,student, ref globalsData);
  19. InitializeComponent();
  20. delBtn.IsVisible = true;
  21. saveBtn.IsVisible = true;
  22. }
  23. }
  24. }