We have an Application, in which we are using xamDockManager, this can be float. Once we drag and make it Floating window, it's title bar color changed to default blue color. We want to change this default blue color to Black. As suggesred in other post we need to add styling in App.xaml file. But as we are hosting WPF forms from WinForm, so that it's hard to set the styling in App.xaml as we are not adding styling here.
Do we have any alternate way, while we are creating object of WPF form or in any other place in code we can set Color for it's title bar.
We are using default.isl file for application level styling in WinForm. Can we set style for Floating window in that file? If yes then please provide the style for it. That would work for us.
Thank you for posting to Infragistics Community!
I have been looking into your question and I believe you are referring to this recent forum thread as the suggested solution to style a Floating window, is this correct?
Please, note that the current forum is the “Ignite UI for Angular” subforum, and as your question is regarding the XamDockManager, please, create further threads on related matters in the dedicated Ultimate UI for WPF subforum. This implies better organization of the forum discussions and allows the community to benefit from them by searching the relevant knowledge areas.
To address your question, you are correct that the App.xaml file is not present when creating a WPF User Control Library and therefore the suggested in the linked thread approach becomes not as straightforward. After further investigation, I found this blog post on “Managing Application Resources when WPF is Hosted”. There you will find three solutions to implementing application-level resources for your hosted WPF control. The article provides detailed information and code-snippets.
In an effort to test this, I went ahead and created sample WinForms project hosting such a WPF user control with a XamDockManager and the resource dictionaries, provided in the linked thread. You can find the archive, containing both projects attached below.
On my side, everything is working as expected and the custom styling is working for floating windows in the hosted control as well. One thing to watch out for is the URI to the resource dictionary to include. Make sure it follows the path “*TheDLLName*;component;*filename.xaml*”.
In conclusion, please check out the referenced article and sample and let me know if I can be of any further assistance. Also, make sure to build the WPF project and add the relevant DockManager and WPF Infragistics assemblies before building and running the WinForms project.
Best regards,Bozhidara PachilovaAssociate Software Developer
Thanks for the answer, it worked for us. One last question, how can we set it like solid title bar color (same as screenshot 1). Currently it's transparent black.
I am glad that you find my suggestion helpful.
To address your new query, what I can say is that, based on the other referenced forum thread, it seems that you are using a Resource Washer over the built-in IGTheme to style the XamDockManager. As you are probably aware, resource washing kind of modifies the main colors to match the specified wash color palette based on the WashMode property.
In order to directly set a particular color, such as the ToolWindow’s caption area, the approach would be to modify the default styles. More specifically, the associated with the target elements brushes. They can be targeted by their keys, such as “ToolWindowActiveCaptionTextFillKey”, “ToolWindowActiveCenterFillKey”, etc. The tool window’s brush keys for the IGTheme can be found in the following file:
C:\Program Files (x86)\Infragistics\*your version*\WPF\DefaultStyles\Windows\PrimitivesIGTheme_Express.xaml
An UI-inspecting tool, such as “Snoop” can be leveraged to check out the target elements that need to be altered and view the styles, setting their Background/Fill/BorderBrush, etc properties. Then, by searching the relevant brush keys in the default style files, they could be copied, modified and added to your project’s Resource dictionary. Attached you will find the WPF sample from the other referenced forum thread, where some of these brush keys are overridden. Please, feel free to adjust the used colors to best match your required looks. There are also “Inactive” styles, which I have included for completeness, but not modified. of course you could modify them as well.
Finally, considering that in this thread, we initially discussed adding application-level resources to a WPF control hosted in WinForms app and your last question is a bit apart from this topic my suggestion would be to create a separate thread for your query regarding styling tool windows.
This makes the information in our forum easily discoverable and helps other community members benefit from the threads consistency. Additionally, it helps us provide you with better and more accurate support. Thank you for understanding.
Sure, You can close this Ticket. Thanks for the brief update.
I am glad that you managed to achieve your requirements. Thank you for using Infragistics components!
Best regards, Bozhidara Pachilova