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

Styling not applied to ToolWindow

2 Answers 127 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Or
Top achievements
Rank 1
Or asked on 13 Mar 2018, 03:36 PM

Our app doesn't start from a C# application but rather for a C++ app, which means all our WPF code runs from dlls.

That means we can't have an App.xaml file so all the resource dictionaries are declared wherever they're needed.

 

When floating a pane, it crates a ToolWindow but the styling is never applied to it, probably because there's no App.xaml.

How can we apply the styling?

2 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 16 Mar 2018, 02:48 PM
Hello,

A suggestion might be to attach a listener to the RadDocking.ToolWindowCreated event and set a style to the ToolWindow directly. You can get the style from the docking resource dictionary when you need it by key - it should be named ToolWindowStyle.

Please, get back to us whether this would be suitable for your case and if you have any other questions, please do not hesitate to contact us further.


Regards,
Martin
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.
0
Or
Top achievements
Rank 1
answered on 18 Mar 2018, 07:58 AM

I ended up doing this:

private void DockingManager_OnToolWindowCreated(object sender, ElementCreatedEventArgs e)
{

    (e.CreatedElement as FrameworkElement)?.Resources.MergedDictionaries.AddRange(Resources.MergedDictionaries);
}

 

I don't like it, but it works.

Tags
Docking
Asked by
Or
Top achievements
Rank 1
Answers by
Martin
Telerik team
Or
Top achievements
Rank 1
Share this question
or