Switching RadPane background between floating/docked states

2 posts, 0 answers
  1. Murali
    Murali avatar
    8 posts
    Member since:
    May 2013

    Posted 22 Oct 2013 Link to this post

    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;
    }


  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 23 Oct 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top