Problem with "blinking" ToolWindows after DockSiteLayoutSerializer.LoadFromString

Docking/MDI for WPF Forum

Posted 12 years ago by Geir Schjorlien
Version: 11.2.0551
Avatar

Hi,

I have an application where I have created some ToolWindows which the user may open/close with a checkbox-control in the Ribbon. These ToolWindows are always floating, are connected to my DockSite and saved/loaded using the DockSiteLayoutSerializer.

Code fragment showing creation of the serializer and one of the tool-windows:

	// Create the layout serializer
 	_layoutSerializer = new DockSiteLayoutSerializer();
	_layoutSerializer.SerializationBehavior = DockSiteSerializationBehavior.All;
	_layoutSerializer.DocumentWindowDeserializationBehavior = DockingWindowDeserializationBehavior.AutoCreate;

	// Create the MediaPlayer tool-window
 	MediaPlayerWindow = new ToolWindow(MyDockSite, "MediaPlayerWindow", "Media Player", null, new MyMediaPlayer());
	MediaPlayerWindow.CanRaft = true;
	MediaPlayerWindow.CanDockBottom = false;
	MediaPlayerWindow.CanDockLeft = false;
	MediaPlayerWindow.CanDockRight = false;
	MediaPlayerWindow.CanDockTop = false;
	MediaPlayerWindow.CanBecomeDocument = false;
  

Show/hide the tool-window:

	public void ShowMediaPlayerWindow(bool show)
	{
		if (show)
		{
			MediaPlayerWindow.Float();
			MediaPlayerWindow.Activate(true);
		}
		else
			MediaPlayerWindow.Close();
	}

 When the application is closed, I'm calling _layoutSerializer.SaveToString(MyDockSite), and when the application starts up, _layoutSerializer.LoadFromString(xml, MyDockSite).

If I run the application, open and close the tool-window and close the application, the saved xml looks like this:

	<RaftingHosts>
		<RaftingHost IsMaximized="false" Location="207,207" Size="194,197" State="Floating">
			<Content xsi:type="ToolWindowContainer" AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="194,197" Size="194,197">
				<UIElement xsi:type="Track" UniqueId="854be9f7-0cc5-43bf-a948-a62a643326fe" />
			</Content>
		</RaftingHost>
	</RaftingHosts>
	<ToolWindows>
		<ToolWindow UniqueId="854be9f7-0cc5-43bf-a948-a62a643326fe" AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="194,197" Size="200,200" IsOpen="false" LastState="Docked" Name="MediaPlayerWindow" RaftingLocation="207,207" State="Floating" />
	</ToolWindows>

When starting the application, the tool-window briefly "blinks".

If I then open and close the tool-window again, the saved xml looks like this:

	<RaftingHosts>
		<RaftingHost IsMaximized="false" Location="207,207" Size="192,196" State="Floating">
			<Content xsi:type="ToolWindowContainer" AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="192,196" Size="192,196">
				<UIElement xsi:type="Track" UniqueId="854be9f7-0cc5-43bf-a948-a62a643326fe" />
			</Content>
		</RaftingHost>
		<RaftingHost IsMaximized="false" Location="207,207" Size="192,196" State="Floating">
			<Content xsi:type="ToolWindowContainer" AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="192,196" Size="192,196" />
		</RaftingHost>
	</RaftingHosts>
	<ToolWindows>
		<ToolWindow UniqueId="854be9f7-0cc5-43bf-a948-a62a643326fe" AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="192,196" Size="200,200" IsOpen="false" LastState="Docked" Name="MediaPlayerWindow" RaftingLocation="207,207" State="Floating" />
	</ToolWindows>

When starting the application, the tool-window now "blinks" twice. It seems the "RaftingHosts" section grows for each time I open and close the tool-window, and more annoyingly, the tool-window "blinks" the same amount of times as there are "RaftingHosts" sections.

I assume I'm doing something wrong in my serialization/deserialization, but how can I avoid the "blinking" tool-windows at startup (and the growing  "RaftingHosts" section)?

 

Thanks,

Geir

Comments (2)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Geir,

If you can please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters. We have a maintenance release coming out soon, so if you can get that to us before that we can probably include any potential fix.


Actipro Software Support

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Geir,

Thank for the sample application. There are a three issues here, the first of which (the growing number of RaftingHosts in the XML file) is corrected by the most recent maintenance release currently available for download.

Fixes for the other two issues, the "blinking" and anempty RaftingHost in the layout data, will be included in the next upcoming maintenance release.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.