Transparent splitter while being dragged

Docking/MDI for WPF Forum

Posted 3 years ago by İevgen
Version: 21.1.1
Avatar

Hello,

The splitter becomes Transparent by default when it is being dragged, but this is not what we want.

How to set the color of the splitter?

We are using 20.1.1

[Modified 3 years ago]

Comments (9)

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

Hello,

If you set the DockSite.IsLiveSplittingEnabled property to false, then it will show a filled in splitter that you move around and the controls will readjust after you drop it.  In this mode, the color of that splitter fill while dragging is fixed to #80808080.  You'd have to make a new implicit Style/Template for the splitter types to alter that color, but it's a good generic color that works with all themes.  If you want to go that route, we can post the default Style.


Actipro Software Support

Posted 3 years ago by İevgen
Avatar

Hello,

I do have IsLiveSplittingEnabled set to False since we are hosting WinForms controls inside the tool windows, but the splitter has Transparent color while dragging it.

The default style which allows to override that color is highly appreciated.

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

First, let me ask something since you mentioned WinForms.  When you first press the mouse down on the splitter when DockSite.IsLiveSplittingEnabled is false, do you see a gray rectangle appear? 

And if so, by "Transparent color" do you mean the gray rectangle disappears when you move it over the WinForms controls?


Actipro Software Support

Posted 3 years ago by İevgen
Avatar

Not really, by tranparent color I mean that after mouse down the one part of the splitter moves with the mouse and the other stays where it was when mouse down was initially pressed. And that part of it that stayed "looses" its original color and makes the Backgound of DockSite visible through it. This is what we want to avoid.

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

The splitters are normally transparent and show the DockSite background through them.  Are you doing something like overriding their default Background to make the splitters always appear differently than the DockSite background, even when not in use?


Actipro Software Support

Posted 3 years ago by İevgen
Avatar

Indeed.

The background is set using such style:

<Style TargetType="docking:SplitContainerSplitter">
   <Setter Property="Background" Value="XYZ"/>
</Style>

[Modified 3 years ago]

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

Thanks, I see now.  The splitters weren't originally designed to render non-transparently when not in use. 

Ok we were able to improve the splitter to not translate itself when IsLiveSplittingEnabled=false and UseHostedPopups=false.  This should be the scenario you are in, and will allow your colored splitter area to remain in place on drags, while still showing the "shadow" drag splitter.  The update will be in the next maintenance release.


Actipro Software Support

Posted 3 years ago by İevgen
Avatar

Thank you for the update!

Would that change/fix still allow to restyle the splitter after I get rid of the interop controls in the tool windows, and switch UseHostedPopups into True?

[Modified 3 years ago]

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

Hello,

There are basically three modes:

  • IsLiveSplittingEnabled=True - The splitter background you set will always be visible, even while dragging.
  • IsLiveSplittingEnabled=False, UseHostedPopups=True - This mode is for compatibility with interop.  It creates a floating WPF Window to host a cloned splitter element.  The splitter background you set will be visible on the original splitter, even while dragging (this is what was improved with the code update for the next build).  The cloned splitter element that is reflecting the drag location will be in a "highlighted" state (semi-transparent gray). 
  • IsLiveSplittingEnabled=False, UseHostedPopups=False - In this mode, when you start dragging the splitter, it changes to a "highlighted" state and it moves with your mouse.  No element is left behind in the original location while dragging, so to answer your question, your custom splitter background will not show in this mode.  If you have no interop and want your splitters to show in a custom background all the time, then you'd have to use IsLiveSplittingEnabled=True.


Actipro Software Support

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.