Docking Performance Problem, Can I disable alpha transparency?

Docking/MDI for WPF Forum

Posted 12 years ago by Alan McCormick
Version: 12.2.0570
Avatar

We are having performance problems with docking on Windows XP and the docking library using a tabbedmdihost. When dragging a window it uses alpha blending. When dragging a rafted window it literally alpha blends the contents of the entire window. I want to disable this completely show that it shows a solid surface, or just an outline or something much less graphics intensive. (It's can be really undesireable to alpha blend over directx content in our application on windows XP with integrated graphics)

How can I disable this application wide? I tried setting it in the theme etc, and it did not have any effect. I need to turn off any and all rounded corners/alpha to see if I can make it usable on lower end machines.

I'm also using the Prism interop library, so my docking windows are passed into my Initialize function from IDockingWindowInitializer. I have a DockSite with TabbedMdiHost in my application shell region.

I either need to disable it application wide, or for a dock site, or less preferably per window..

Comments (11)

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

Hi Alan,

I believe you can do this in your Application.Resources, although it won't look very good:

<Style TargetType="{x:Type docking:PreviewControl}">
	<Setter Property="Opacity" Value="1" />
</Style>

 That will end up applying to all drags.  Also our new Metro Light theme has mostly solid colors and no rounded corners.  So that may be helpful as well.


Actipro Software Support

Posted 12 years ago by Alan McCormick
Avatar

This code had no effect on my application. 

 <Application.Resources>
		<Style TargetType="{x:Type docking:PreviewControl}">
			<Setter Property="Opacity"
					Value="1" />
		</Style>
	</Application.Resources>
</Application>

 

Perhaps it is because all of my windows that use docking are in a separate DLL from the main shell (I'm using Prism)?

I also tried this...

ActiproSoftware.Windows.Themes.SharedThemeCatalogRegistrar.Register();
			ThemeManager.CurrentTheme = ThemeName.MetroLight.ToString();

I wasn't sure if I need to register a registrar or not, and I could not find any example for MetroLight. I tried several different Registrars that I saw. I had previously tried the OfficeBlack theme and it did work.  When I used MetroLight I didn't really notice any difference? Everything still used transparency.

Posted 12 years ago by Alan McCormick
Avatar

Have you tested this and does it work? I tried it in a simple application not using prism etc and it didn't seem to have an effect.

Posted 12 years ago by Alan McCormick
Avatar

Alright, I found out how to make it work.. At least primarily.

<Application.Resources>
		<Style TargetType="{x:Type docking:DockingWindowDockedDropTarget}">
			<Setter Property="Opacity"
					Value="1" />
		</Style>
		<Style TargetType="{x:Type docking:DockingWindowRaftingDropTarget }">
			<Setter Property="Opacity"
					Value="1" />
		</Style>
	</Application.Resources>

Apparently the style cannot be applied to the parent control. I still have some concerns about it having cutouts for the preview for the tab on documents, and the rounded corners on the glyphs for dropping. I think it would be better if they were rectangular, but I will test if this helps.

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

Hi Alan,

I was just writing the following up when your latest post came through.  I thought our original style would do the trick but it appears we do need to target the derived types instead like this as you found:

<Style TargetType="{x:Type docking:DockingWindowDockedDropTarget}">
	<Setter Property="Opacity" Value="1" />
</Style>
<Style TargetType="{x:Type docking:DockingWindowRaftingDropTarget}">
	<Setter Property="Opacity" Value="1" />
</Style>

I verified that that will work.

For the Metro Light theme, please make sure you read through the "Getting Started" documentation on Themes since it tells you the required steps on setting up that theme (it ships in a separate .dll) and requires registration.  It doesn't do anything with transparency though, it just doesn't have rounded borders on elements.


Actipro Software Support

Posted 12 years ago by Alan McCormick
Avatar

Alright that had an definite improvement on drop preview for tabs, but rafting can still be a bit of problem. I'm looking at not displaying the content of the window while dragging now, or possible turning on the alpha blue shading over the content of the rafting window.. Not sure if I need to modify the control template or what for that..

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

For both removing the tab border and the rafting shading, you could probably add Template setters to both those styles that have a simple border in the template.


Actipro Software Support

Posted 12 years ago by Alan McCormick
Avatar

Thanks, yes I've been testing more today and I did do just what you said.

<Style TargetType="{x:Type docking:DockingWindowRaftingDropTarget}">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Border Background="LightBlue" />
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Opacity"
					Value="1" />
		</Style>

 I have one more problem at least.. I noticed with a lot of windows open on the lower end machine that the docking glyphs (the images you mouse over to drop), fade in and out. This is causing it to be choppy when I really abuse the video ram on this machine. Can I disable that too? I dunno what that thing is called or how to disable the animation. (I'm sorta new to WPF as well).

I guess i'll have to make my own style for low end machines and disable some of these effects.. Maybe WPF can disable all the fade in/out effects globally with the RenderOptions? Anyway, if you know of how to fix the glyphs to be simpler performance wise that would be great.

This machine isn't that bad either.. it is my old dev machine. Windows XP an NVS Quadro 285, 3 GB ram, and a quad core q6600. Just when I have a lot of tabs and mixed directx content it starts using quite a bit of video memory.

Oh one more thing... As you can see, for now, I just set the Background to  "lightblue". Is there a way to set the Border to a solid color based off of the active theme? I want to be able to change the theme, but just get a solid color.. There's probably a way to tap into the theme color for that..

[Modified 12 years ago]

Posted 12 years ago by Alan McCormick
Avatar

Ok, so I was able to find out that it is called a DockGuide, but I do not know how to disable the Opacity animation in a application wide style.

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

Hi Alan,

The dock guide animation is implemented internally in code.  We will add a DockSite.DockGuideAnimationDuration property in the next maintenance release that you can set to 0 to disable the animation.

As for colors, you can easily reuse any of our colors we define in our themes since everything is implemented with reusable brush assets.  The Themes QuickStarts show how and you can find more documentation in the Themes topics too.


Actipro Software Support

Posted 12 years ago by Alan McCormick
Avatar

Alright thanks. Before you replied I was looking at trying to define some sort of style or template basedon the old one, but I am not sure that is possible because I believe the DockGuide is its own window, or I can't view the template because the constructor is protected and my tools like Expression Blend I normally have to create one first.

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

Add Comment

Please log in to a validated account to post comments.