|
@@ -97,7 +97,7 @@ public abstract class MasterDetailPanel<TMaster, TMasterGrid, TSettings> : Maste
|
|
|
|
|
|
}
|
|
|
|
|
|
- protected void CreatePage<TPage>(Func<bool> isAllowed, string caption)
|
|
|
+ protected TPage? CreatePage<TPage>(Func<bool> isAllowed, string caption)
|
|
|
where TPage : class, IMasterDetailPage<TMaster>
|
|
|
{
|
|
|
if (isAllowed())
|
|
@@ -105,14 +105,19 @@ public abstract class MasterDetailPanel<TMaster, TMasterGrid, TSettings> : Maste
|
|
|
var header = new DynamicTabItem() { Header = caption };
|
|
|
_tabControl.Items.Add(header);
|
|
|
if (Activator.CreateInstance(typeof(TPage), header) is TPage page)
|
|
|
+ {
|
|
|
_pages.Add(page);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
- protected void CreatePage<TPage>(string caption)
|
|
|
+ protected TPage? CreatePage<TPage>(string caption)
|
|
|
where TPage : class, IMasterDetailPage<TMaster>
|
|
|
{
|
|
|
- CreatePage<TPage>(() => true, caption);
|
|
|
+ return CreatePage<TPage>(() => true, caption);
|
|
|
}
|
|
|
|
|
|
public void Shutdown(CancelEventArgs? cancel)
|