using System.Collections.Generic;
using InABox.Core;
using InABox.DynamicGrid;

namespace InABox.Wpf;

public abstract class MasterDetailPage<TMaster> : IMasterDetailPage<TMaster>
{

    protected MasterDetailPage(DynamicTabItem tab)
    {
        Tab = tab;
    }
    
    public DynamicTabItem Tab { get; set; }

    public abstract Dictionary<string, object[]>? Selected();

    public IDataModelSource Refresh(TMaster? master)
    {
        Master = master;
        return Refresh();
    }
    
    protected abstract IDataModelSource Refresh();
    
    public abstract IDataModelSource? DataModelSource();
    
    public TMaster? Master { get; set; }
}