MainPage.axaml.cs 479 B

1234567891011121314151617181920
  1. using Avalonia.Controls;
  2. using AvaloniaApplication4.Models;
  3. using AvaloniaApplication4.ViewModels;
  4. namespace AvaloniaApplication4.Views
  5. {
  6. public partial class MainPage : UserControl
  7. {
  8. public MainPage()
  9. {
  10. DataContext = new MainPageViewModel();
  11. InitializeComponent();
  12. }
  13. public MainPage(User? user)
  14. {
  15. DataContext = new MainPageViewModel(user);
  16. InitializeComponent();
  17. }
  18. }
  19. }