SignUpView.xaml.cs 989 B

12345678910111213141516171819202122232425262728
  1. using System.Reactive.Disposables;
  2. using Avalonia.ReactiveUI;
  3. using Generators.Sandbox.ViewModels;
  4. using ReactiveUI;
  5. namespace Generators.Sandbox.Views;
  6. /// <summary>
  7. /// This is a sample view class with typed x:Name references generated using
  8. /// .NET 5 source generators. The class has to be partial because x:Name
  9. /// references are living in a separate partial class file. See also:
  10. /// https://devblogs.microsoft.com/dotnet/new-c-source-generator-samples/
  11. /// </summary>
  12. public partial class SignUpView : ReactiveWindow<SignUpViewModel>
  13. {
  14. public SignUpView()
  15. {
  16. // The InitializeComponent method is also generated automatically
  17. // and lives in the autogenerated part of the partial class.
  18. InitializeComponent();
  19. this.WhenActivated(disposables =>
  20. {
  21. this.WhenAnyValue(view => view.ViewModel)
  22. .BindTo(this, view => view.SignUpControl.ViewModel)
  23. .DisposeWith(disposables);
  24. });
  25. }
  26. }