1
0

NonControl.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Avalonia.Controls;
  2. namespace Avalonia.Markup.Xaml.UnitTests.Xaml
  3. {
  4. public class NonControl : AvaloniaObject
  5. {
  6. public static readonly StyledProperty<Control> ControlProperty =
  7. AvaloniaProperty.Register<NonControl, Control>(nameof(Control));
  8. public static readonly StyledProperty<string> StringProperty =
  9. AvaloniaProperty.Register<NonControl, string>(nameof(String));
  10. //No getter or setter Avalonia property
  11. public static readonly StyledProperty<int> FooProperty =
  12. AvaloniaProperty.Register<NonControl, int>("Foo");
  13. //getter only Avalonia property
  14. public static readonly StyledProperty<string> BarProperty =
  15. AvaloniaProperty.Register<NonControl, string>(nameof(Bar));
  16. public Control Control
  17. {
  18. get => GetValue(ControlProperty);
  19. set => SetValue(ControlProperty, value);
  20. }
  21. public string String
  22. {
  23. get => GetValue(StringProperty);
  24. set => SetValue(StringProperty, value);
  25. }
  26. public string Bar => GetValue(BarProperty);
  27. }
  28. }