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

Switching RadPane background between floating/docked states

1 Answer 20 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Murali
Top achievements
Rank 1
Murali asked on 22 Oct 2013, 03:46 PM
I have spent a good amount of time looking for a way to do this but I finally had to contact support y'day.  I did not find any hits in the forum archive as well so, cross-posting this solution here for any mortals like me could find it in future.  To their credit, support team was swift in getting the answer!

If you need a way to set RadPane's background differently based on whether it is docked or floating, you will have to do this from the RadPaneGroup that the pane belongs to.  Although, the group can be styled in XAML, I prefer the following because I needed this be done only for the panes that go floating in runtime while all docked panes remain transparent.

XAML:
<telerik:RadDocking PaneStateChange="Dock_PaneStateChanged"/>

CodeBehind:
private void Dock_PaneStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
        RadPane pane = e.OriginalSource as RadPane;
 
        if(pane == null) return;
 
        RadPaneGroup pGroup = pane.ParentOfType<RadPaneGroup>();
 
        pGroup.Background = pane.IsFloating? Brushes.DarkMagenta : Brushes.Transparent;
}


1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 23 Oct 2013, 12:07 PM
Hi Murali,

Thank you for sharing the solution with the community.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Murali
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or