Добавлена проверка

This commit is contained in:
kotcheshir73 2021-04-03 10:50:51 +04:00
parent 4bb7f3c12c
commit 6992a7df68

View File

@ -84,19 +84,22 @@ namespace DesktopTools.Controls
try
{
_element = value;
SetValues?.Invoke(_element);
if (tabControl.Visible)
if (_element != null)
{
foreach (TabPage page in tabControl.TabPages)
SetValues?.Invoke(_element);
if (tabControl.Visible)
{
if (page.Name == tabPageMain.Name)
foreach (TabPage page in tabControl.TabPages)
{
continue;
}
if (page.Controls[0] is IControlChildEntity cntrl)
{
cntrl.ParentId = _element.Id;
cntrl.Open(new ControlOpenModel { OpenMode = ControlOpenMode.Child });
if (page.Name == tabPageMain.Name)
{
continue;
}
if (page.Controls[0] is IControlChildEntity cntrl)
{
cntrl.ParentId = _element.Id;
cntrl.Open(new ControlOpenModel { OpenMode = ControlOpenMode.Child });
}
}
}
}