I'm trying to build a WPF application that has areas of transparency, so that whatever is underneath the application can be seen.
To do this, I have been setting the following settings in the Window's XAML:
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
However, when I add a XamRibbon to the window, I am unable to get the minimise / maximise, restore and close buttons to show.
I am also unable to move or resize the application.
I've overcome moving by calling Window.DragMove() from the window's MouseLeftButtonDown event handler.
Any ideas?
Hello,
Making the window transparent is tied to setting the WindowStyle to None meaning we will lose all the features of the non-client area. Once we do that we need to take care of all the content as well as the buttons available when the non-client area is used. I am attaching a small sample application showing an implementation of such a window for your reference. Other useful resources are the following threads:
http://stackoverflow.com/questions/13930633/in-wpf-can-i-have-a-borderless-window-that-has-regular-minimize-maximise-and-c
https://blogs.msdn.microsoft.com/wpfsdk/2010/08/25/experiments-with-windowchrome/
Please let me know if you have any further questions regarding this matter.
Thanks a lot for your help Galina,
That looks close to what I'm looking for.
However, in your sample solution, you've added the three buttons in a grid above the ribbon, whereas I was looking to have them on the XamRibbon, as they are when you use
WindowStyle="SingleBorderWindow"
I assumed that you'd have to modify the CaptionButtonAreaTemplate in the RibbonOffice2013.xaml resource dictionary somehow.
I couldn't see anything in any of the XamRibbonCaptionButton_ styles that may have been setting the buttons invisible, which caused me to write the above post.
Is it even possible to have the buttons on the XamRibbon, or is creating a separate button bar above it the only solution?
Hello and Happy New Year!
Thank you for the details. I took a slightly different approach and created a new sample application which I believe covers your requirements.
Please review it and let me know if you need any further assistance on the matter.
Thanks a lot, Galina!
That's exactly what I'm looking for.
Regards,
Aaron