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

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 try
{ {
_element = value; _element = value;
SetValues?.Invoke(_element); if (_element != null)
if (tabControl.Visible)
{ {
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.Name == tabPageMain.Name)
} {
if (page.Controls[0] is IControlChildEntity cntrl) continue;
{ }
cntrl.ParentId = _element.Id; if (page.Controls[0] is IControlChildEntity cntrl)
cntrl.Open(new ControlOpenModel { OpenMode = ControlOpenMode.Child }); {
cntrl.ParentId = _element.Id;
cntrl.Open(new ControlOpenModel { OpenMode = ControlOpenMode.Child });
}
} }
} }
} }