MainWindow.xaml.cs 789 B

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