1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections.Generic;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace InABox.Wpf;
- public abstract class MasterDetailPanelPage<TMaster,TPanel> : MasterDetailPage<TMaster>
- where TPanel : class, IBasePanel, IMasterDetailControl<TMaster>, new()
- {
- public MasterDetailPanelPage(DynamicTabItem tab) : base(tab) { }
-
- public TPanel? Panel { get; set; }
- public override Dictionary<string, object[]>? Selected() => Panel?.Selected();
- protected abstract void DoRefresh(TPanel panel);
-
- protected override IDataModelSource Refresh()
- {
-
- if (Panel == null)
- {
- Panel = new TPanel
- {
- IsReady = false
- };
- Panel.Setup();
- Panel.IsReady = true;
- Tab.Content = Panel;
- }
- Panel.Master = Master;
- DoRefresh(Panel);
- return Panel;
- }
- }
|