using System.Collections; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.Templates; namespace AutoCat.Views; public partial class MasterDetailView : UserControl { #region Dependency properties public static readonly StyledProperty ItemTemplateProperty = AvaloniaProperty.Register(nameof(ItemTemplate)); public static readonly StyledProperty DetailTemplateProperty = AvaloniaProperty.Register(nameof(DetailTemplate)); public static readonly StyledProperty EmptyDetailTemplateProperty = AvaloniaProperty.Register(nameof(EmptyDetailTemplate)); public static readonly StyledProperty ItemsSourceProperty = AvaloniaProperty.Register(nameof(ItemsSource)); #endregion #region Properties public IDataTemplate? ItemTemplate { get => GetValue(ItemTemplateProperty); set => SetValue(ItemTemplateProperty, value); } public IDataTemplate? DetailTemplate { get => GetValue(DetailTemplateProperty); set => SetValue(DetailTemplateProperty, value); } public IDataTemplate? EmptyDetailTemplate { get => GetValue(EmptyDetailTemplateProperty); set => SetValue(EmptyDetailTemplateProperty, value); } public IEnumerable? ItemsSource { get => GetValue(ItemsSourceProperty); set => SetValue(ItemsSourceProperty, value); } #endregion public MasterDetailView() { InitializeComponent(); DataContext = this; } }