using Connected.Annotations; using Microsoft.AspNetCore.Components; namespace Connected.Components; public abstract class BindableItemsControlBase : ItemsControlBase where TChildComponent : UIComponent { /// /// Items Collection - For databinding usage /// [Parameter] [Category(CategoryTypes.General.Data)] public IEnumerable ItemsSource { get; set; } /// /// Template for each Item in ItemsSource collection /// [Parameter] [Category(CategoryTypes.General.Appearance)] public RenderFragment ItemTemplate { get; set; } /// /// Gets the Selected Item from ItemsSource, or Selected TChildComponent, when it's null /// public object SelectedItem { get => ItemsSource == null ? Items[SelectedIndex] : ItemsSource.ElementAtOrDefault(SelectedIndex); } }