MainWindow.xaml.cs 805 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System;
  4. using Avalonia;
  5. using Avalonia.Controls;
  6. using Avalonia.Markup.Xaml;
  7. using RenderTest.ViewModels;
  8. using ReactiveUI;
  9. using Avalonia.Rendering;
  10. namespace RenderTest
  11. {
  12. public class MainWindow : Window
  13. {
  14. public MainWindow()
  15. {
  16. this.InitializeComponent();
  17. this.AttachDevTools();
  18. var vm = new MainWindowViewModel();
  19. vm.WhenAnyValue(x => x.DrawFps).Subscribe(x => RendererMixin.DrawFpsCounter = x);
  20. this.DataContext = vm;
  21. }
  22. private void InitializeComponent()
  23. {
  24. AvaloniaXamlLoader.Load(this);
  25. }
  26. }
  27. }