// Copyright (c) The Perspex Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using Perspex.Controls.Mixins; namespace Perspex.Controls { /// /// A selectable item in a . /// public class ListBoxItem : ContentControl, ISelectable { /// /// Defines the property. /// public static readonly PerspexProperty IsSelectedProperty = PerspexProperty.Register(nameof(IsSelected)); /// /// Initializes static members of the class. /// static ListBoxItem() { SelectableMixin.Attach(IsSelectedProperty); FocusableProperty.OverrideDefaultValue(true); } /// /// Gets or sets the selection state of the item. /// public bool IsSelected { get { return GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } } }