In 2.9/net48 we have some code were we create a GroupElement first and then create some further elements afterwards which have the GroupElement as their container. All this child elements got this GroupElement as their parent. In 3.1 SDK this behaviour seems to be broken or atleast it has changed.
In 3.1 SDK it seems that all ParentElements get nulled if another element is created within that group. That probably leads to many NullPointerExceptions which we got now after upgrading to 3.1. This behaviour is event watchable when assigning the child elements straight up when calling the CreateGroupElement.
var group1 = ElementFactory.Instance.CreateGroupElement(layout, new List<Element> (), "group1");
var test1 = ElementFactory.Instance.CreateMapFrameElement(group1, frameBounds, templateMap);
// test1.GetParent() > group1
test1.SetHeight(100.0); // > works
var test2 = ElementFactory.Instance.CreateMapFrameElement(group1, frameBounds, templateMap);
// test1.GetParent() > null
// test2.GetParent() > group1
test1.SetHeight(100.0); // > NullPointerException
test2.SetHeight(100.0); // > works
var test3 = ElementFactory.Instance.CreateMapFrameElement(layout, frameBounds, templateMap);
var test4 = ElementFactory.Instance.CreateMapFrameElement(layout, frameBounds, templateMap);
var group2 = ElementFactory.Instance.CreateGroupElement(layout, new List<Element> { test3, test4 }, "group2");
// test3.GetParent() > null
// test4.GetParent() > null
test3.SetHeight(100.0); // > NullPointerException
test4.SetHeight(100.0); // > NullPointerException
There were alot of changes to the Element-/Layout factories. Many code snippets just went broke as soon as we updated to 3.1 and ran totally fine pre 3.x.