protected override void SaveEntity2Memory(Stream memory)
        {
            DockPanel panel = (DockPanel)entity;
            DockPanelSettings settings = new DockPanelSettings();

            foreach (UIElement element in panel.Children)
            {
                var dockChildSettings = new DockPanelChildSettings();

                element.IfInstanceOf<FrameworkElement>(e =>
                                                       	{
                                                       		dockChildSettings.Width = e.Width;
                                                       		dockChildSettings.Height = e.Height;
                                                       	});

                settings.AddChild(dockChildSettings);
            }

            serializer.Serialize(memory,settings);
        }
 public void AddChild(DockPanelChildSettings settings)
 {
     children.Add(settings);
 }