This project is read-only.

[Version 2.0] Serialising: FloatingLeft and FloatingTop relative to desktop and not parent container?

Jan 18, 2014 at 1:05 PM
Hi, I am trying to serialise and de-serialise a bunch of docking managers in my application. It appears as if serialisation and de-serialisation have different reference points concerning the position of anchorables. My PC has two displays and if I place the main window at the top left corner of display 1 and serialise I get something like this:
        <RootPanel Orientation="Horizontal">
          <LayoutAnchorablePane FloatingWidth="1566" FloatingHeight="882" FloatingLeft="-755" FloatingTop="529">
            <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Clock" IsSelected="True" ContentId="c902e288-a4b2-4fc3-8b4c-129a11006983" FloatingLeft="-755" FloatingTop="529" FloatingWidth="1566" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:47:04" />
          </LayoutAnchorablePane>
          <LayoutAnchorablePaneGroup Orientation="Vertical">
            <LayoutAnchorablePane FloatingWidth="781" FloatingHeight="882" FloatingLeft="799" FloatingTop="479">
              <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Deck 1" IsSelected="True" ContentId="17bed6e4-502a-480f-9c7d-46a6c7dcfd95" FloatingLeft="799" FloatingTop="479" FloatingWidth="781" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:47:09" />
            </LayoutAnchorablePane>
            <LayoutAnchorablePane FloatingWidth="781" FloatingHeight="882" FloatingLeft="800" FloatingTop="346">
              <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Sound FX" IsSelected="True" ContentId="c239fe4d-8777-4e65-9c4b-e06a133415b4" FloatingLeft="800" FloatingTop="346" FloatingWidth="781" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:47:18" />
            </LayoutAnchorablePane>
            <LayoutAnchorablePane FloatingWidth="781" FloatingHeight="882" FloatingLeft="795" FloatingTop="339">
              <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Deck 2" IsSelected="True" ContentId="ea36ff0a-82f1-43ce-b3aa-8a7bce724beb" FloatingLeft="795" FloatingTop="339" FloatingWidth="781" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:47:13" />
            </LayoutAnchorablePane>
          </LayoutAnchorablePaneGroup>
        </RootPanel>
If I instead place the main window at the top left of the second display and serialise I get something like this:
        <RootPanel Orientation="Horizontal">
          <LayoutAnchorablePane FloatingWidth="1566" FloatingHeight="882" FloatingLeft="-2434" FloatingTop="524">
            <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Clock" IsSelected="True" ContentId="b8220dca-9534-43c0-ae1d-e82a69d62fd0" FloatingLeft="-2434" FloatingTop="524" FloatingWidth="1566" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:48:58" />
          </LayoutAnchorablePane>
          <LayoutAnchorablePaneGroup Orientation="Vertical">
            <LayoutAnchorablePane FloatingWidth="781" FloatingHeight="882" FloatingLeft="-885" FloatingTop="487">
              <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Deck 1" IsSelected="True" ContentId="b4a352d9-f4c3-4c17-966a-25db348172b5" FloatingLeft="-885" FloatingTop="487" FloatingWidth="781" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:49:02" />
            </LayoutAnchorablePane>
            <LayoutAnchorablePane FloatingWidth="781" FloatingHeight="882" FloatingLeft="-885" FloatingTop="335">
              <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Sound FX" IsSelected="True" ContentId="5120bf3f-4c4f-4f9b-bf7b-1ed0e61aae41" FloatingLeft="-885" FloatingTop="335" FloatingWidth="781" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:49:08" />
            </LayoutAnchorablePane>
            <LayoutAnchorablePane FloatingWidth="781" FloatingHeight="882" FloatingLeft="-885" FloatingTop="333">
              <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Deck 2" IsSelected="True" ContentId="c9720f4d-27e5-4bd4-89bf-3298006553f8" FloatingLeft="-885" FloatingTop="333" FloatingWidth="781" FloatingHeight="882" LastActivationTimeStamp="01/18/2014 13:49:05" />
            </LayoutAnchorablePane>
          </LayoutAnchorablePaneGroup>
        </RootPanel>
Notice the difference in the FloatingLeft attributes.

Now, when I de-serialise, I think that the docking manager does the right thing and assumes that the serialised coordinates are, in fact, relative to the parent container and not the desktop. The end-result is that the anchorables are way off location - as in not even visible after de-serialisation.

Am I doing something wrong or could this be a bug in the docking manager?