This is a migrated thread and some comments may be shown as answers.

Creating a UserControl with themeable GridSplitters

6 Answers 118 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 18 Feb 2014, 03:59 PM
I need to create a 3-panel User Control (a left and right panel in the top half of the control and a single panel in the bottom half).  I need the panel sizes to be interactively adjustable via some sort of splitter control.  Further, the entire control needs to be dynamically themeable via the Telerik Implicit Styles.  I *do not* need (or want) the panels to be moveable, dockable, floatable, pinnable, etc.

Originally, I just used the stock WPF GridSplitter, but immediately realized that it doesn't match the currently selected Telerik theme. I know I can create the control using RadDocking, RadSplitContainer, RadPaneGroup, and RadPane controls and that'll get me the themed splitter control I need, but that seems like overkill in this case.

Can I create a simple 3-panel layout complete with themed splitter controls without resorting to RadDock and friends?  If so, how?

Thanks,

Jeff

6 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 18 Feb 2014, 05:45 PM
Update...

While waiting for some forum input, I've done some experimenting.  My main application already contains a Docking control that divides it's space into a left and right panel.  The left panel contains a RadTreeView control and the right panel contains a RadTabControl, which is used to display various UserControls based on the currently selected node in the Tree.

As an experiment, I've created the UserControl I mention in the original post using RadDocking as the main container.  In a simple, standalone test project, this works as expected.  However, when I add that RadDocking-based UserControl to my main app (which already *has* a RadDocking control), RadDocking.CheckIsPlacedCorrectly() throws the following error:

"Placing Docking control in another Docking control is not supported in the current version. You can disable this error by setting the AllowUnsafeMode property of the inner RadDocking control."

So, it seems that using multiple levels of Docking is, at the very least, being discouraged.  I don't think I want to go down the road of using "AllowUnsafeMode" as suggested by the above message.

So, now I guess my original question becomes 2-fold:
  1. Ideally, I'd still like to find a light-weight solution to my 3-panel UserControl with themeable GridSplitters.
  2. If that's not possible, how can I create a UserControl that contains RadSplitContainers for insertion into an application that already contains an outer Docking control?

Thanks,

Jeff

0
Jeff
Top achievements
Rank 1
answered on 18 Feb 2014, 06:48 PM
Update #2...

I've settled on basing my UserControl on a simple grid and am just using the default WPF GridSplitter control to resize the panels.  Currently, I've just assigned the Background to a light gray and the Opacity to 0.3.  This way, the color of the current theme shows through the GridSplitter so it doesn't look too out of place when the theme changes. 

However, if there's a way to "properly" theme the standard GridSplitter, I'd like to know.

Thanks,

Jeff
0
Kalin
Telerik team
answered on 21 Feb 2014, 09:23 AM
Hi Jeff,

The Docking in Docking scenario is currently in development, what I can suggest you at the moment is to subscribe to the Feedback item and get notified when it is completed. You can find it on the following link:
http://feedback.telerik.com/Project/143/Feedback/Details/114015-nested-raddocking-in-raddocking-controls

Stay tuned for updates next week. As for the styling the regular WPF GridSplitter question - what I can suggest you is to check the MSDN forums for more details.

Hope this helps.

Regards,
Kalin
Telerik
0
Jeff
Top achievements
Rank 1
answered on 21 Feb 2014, 07:30 PM
Kalin,

Thanks for the info and the link.  While I'd definitely like to see "Docking in Docking" support, I really think it's overkill for my current scenario anyway - since all I really want is themed splitters (and no other docking functionality). 

With that in mind, I'll definitely stick with a simpler / lighter-weight grid-based design in this case with standard WPF GridSplitter controls.  However, I'd still like to style them according to the currently selected theme.  My app uses the NoXAML binaries and implicit themes.

I could probably get away with simply setting the Background property of my GridSplitter to an appropriate, named Brush from the current theme.  It's just unclear to me what the appropriate theme Brush might be.

Any suggestions?

Jeff
0
Kalin
Telerik team
answered on 26 Feb 2014, 12:08 PM
Hi Jeff,

Unfortunately there isn't a brush with the same Key present in all of themes that which you can set as background of the GridSplitter. However I can provide you the colors of the resizer inside of the Docking control for each theme and you could create a custom ResourceDictionary for each theme containing a brush with the same name and different color. Afterwards you need to set this brush as DynamicResource of the Background property of the GridSplitter and when changing the theme to merge the ResourceDictionary with the required color to be present for  the GridSplitter.

Here are the mentioned colors:

OfficeBlack/OfficeBlue/OfficeSilver: #B2FFCD27
Windows7: #FF868686
ExpressionDark: #66789FC3
Transparent: #99000000
Windows8: #33767676
Windows8Touch: #7FCCCCCC
Office2013: #7F0072C6
Vist: #FFCEE5FC
Summer: #FF0E7194

Hope this helps.

Regards,
Kalin
Telerik
0
Jeff
Top achievements
Rank 1
answered on 26 Feb 2014, 02:02 PM
Kalin,

Thanks for the additional input.  I'll try to define a custom ResourceDictionary as mentioned.

Jeff
Tags
Docking
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or