NonControl.cs 1.3 KB

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