1
0

MainWindow.xaml.cs 1012 B

12345678910111213141516171819202122232425262728293031323334
  1. using Avalonia;
  2. using Avalonia.Controls;
  3. using Avalonia.Controls.Notifications;
  4. using Avalonia.Markup.Xaml;
  5. using Avalonia.Threading;
  6. using ControlCatalog.ViewModels;
  7. using System;
  8. using System.Threading.Tasks;
  9. namespace ControlCatalog
  10. {
  11. public class MainWindow : Window
  12. {
  13. public MainWindow()
  14. {
  15. this.InitializeComponent();
  16. this.AttachDevTools();
  17. //Renderer.DrawFps = true;
  18. //Renderer.DrawDirtyRects = Renderer.DrawFps = true;
  19. DataContext = new MainWindowViewModel();
  20. }
  21. private void InitializeComponent()
  22. {
  23. // TODO: iOS does not support dynamically loading assemblies
  24. // so we must refer to this resource DLL statically. For
  25. // now I am doing that here. But we need a better solution!!
  26. var theme = new Avalonia.Themes.Default.DefaultTheme();
  27. theme.TryGetResource("Button", out _);
  28. AvaloniaXamlLoader.Load(this);
  29. }
  30. }
  31. }