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

Title Templates when RadPane in different situations

1 Answer 82 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Miles
Top achievements
Rank 1
Miles asked on 24 Apr 2018, 02:52 PM

Hi,

I am trying to get titletemplates to work depending their associated RadPane docking positions within a RadDocking control. The title template should contain a button next to the header which I have set correctly if the RadPane is docked and visible.

However, if the panel is unpinned/closed or floating I need to hide the button. How do I achieve this? Currently I have a bad workaround which checks FindAncestor for type AutoHideArea, ToolWindow or RadPaneGroup in a Visibility Binding for the button.

 

Could anyone please suggest a better way for me to check what the RadPane's current state would be within a separate template for titletemplates?

Thank you.

M.Young

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 27 Apr 2018, 10:06 AM
Hello Miles,

To better assist you and understand your scenario, can you send me code snippet which demonstrates how you have set this button in the header of the pane.

To know when pane state is changed you subscribe to the PaneStateChange or ToolWindowCreated events. The first event is fired when pane changed its states. You can check if it is changed to a floating using IsFloating property.
private void radDocking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    var pane = e.OriginalSource as RadPane;
    if (pane.IsFloating)
    {
        ;
    }
}

The second event is fired when ToolWindow is created. You can get the ToolWindow from the event arguments.
private void radDocking_ToolWindowCreated(object sender, Telerik.Windows.Controls.Docking.ElementCreatedEventArgs e)
{
    var window = e.CreatedElement as ToolWindow;           
}

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Docking
Asked by
Miles
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or