Avalonia based Editor for Romhackers

TabItemIcon.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Avalonia;
  2. using Avalonia.Controls;
  3. using Avalonia.Controls.Mixins;
  4. using Avalonia.Controls.Primitives;
  5. using System;
  6. namespace Editopia.Control
  7. {
  8. public class TabItemIcon : HeaderedContentControl, ISelectable
  9. {
  10. /// <summary>
  11. /// Defines the <see cref="IsSelected"/> property.
  12. /// </summary>
  13. public static readonly StyledProperty<bool> IsSelectedProperty =
  14. ListBoxItem.IsSelectedProperty.AddOwner<TabItem>();
  15. /// <summary>
  16. /// Initializes static members of the <see cref="TabItem"/> class.
  17. /// </summary>
  18. static TabItemIcon()
  19. {
  20. SelectableMixin.Attach<TabItemIcon>(IsSelectedProperty);
  21. FocusableProperty.OverrideDefaultValue(typeof(TabItem), true);
  22. }
  23. /// <summary>
  24. /// Gets or sets the selection state of the item.
  25. /// </summary>
  26. public bool IsSelected
  27. {
  28. get { return GetValue(IsSelectedProperty); }
  29. set { SetValue(IsSelectedProperty, value); }
  30. }
  31. }
  32. }