4

I am adding a ItemControl into panel dynamically as you see in the below code.

try
{
   if (!this.DockPanel.Children.Contains(itemControl))
   {
      this.DockPanel.Children.Add(itemControl);
   }
}
catch(Exception e)
{
    Debug.WriteLine(e.Message);
}

I already have two children in the Panel and the itemControl has values. But when i add ItemControl into panel it throw exceptions like

"No installed components were detected. Child collection must not be modified during measure or arrange "

I searched the root cause for this exception. But no reference or blog was found to clear this issue. Anyone advise me to solve this.

Thanks, Bharathiraja.

Bharathi
  • 1,288
  • 2
  • 14
  • 40

0 Answers0