I have several panes containing content that all have their ContentIds. I want to be able to find one of the panes so I can set it to the active content. Let's call that MyContentView. In a different view, I press a button that does something like this:
LayoutContent content = FindContentById("myContent");
if(content == null)
{
content = new MyContentView();
content.ContentId = "myContent";
this.MyLayoutDocumentPane.Children.Add(content);
}
this.MyDockingManager.ActiveContent = content;
I can't just hold on to that content because I will later serialize the layout, close the app, and deserialize on startup. This code will not run and I will not have that reference.
Why not just loop down the MyLayoutDocument Pane children? MyContentView can float and when that happens, it is no longer in that container.