AddTeacherView.axaml.cs 620 B

1234567891011121314151617181920212223242526272829
  1. using Avalonia;
  2. using Avalonia.Controls;
  3. using Avalonia.Markup.Xaml;
  4. using Teachers.ViewModels;
  5. namespace Teachers;
  6. public partial class AddTeacherView : UserControl
  7. {
  8. public AddTeacherView()
  9. {
  10. InitializeComponent();
  11. DataContext = new AddTeacherViewModel();
  12. }
  13. public AddTeacherView(int idTeacher)
  14. {
  15. InitializeComponent();
  16. DataContext = new AddTeacherViewModel(idTeacher);
  17. }
  18. public void UpdatePage()
  19. {
  20. //var dc = this.DataContext;
  21. //this.DataContext = null;
  22. //this.DataContext = dc;
  23. //cbc.Items = this.DataContext
  24. }
  25. }