Click here to Skip to main content
11,927,190 members (52,608 online)
Rate this:
Please Sign up or sign in to vote.
See more: WPF User-controls

The project here is in WPF and the main shell is using GlassWindow appearance, meaning AllowTransparency property is set to true.
The problem with this property is that it doesn`t go well with DirectX.
We have a user control inside our app and inside that user control we display streaming video.

The user control cannot internally control the transparency. The property AllowTransparency must relate to a window with a handle.

How can I make the user control ignore the transparency?

Posted 26-Dec-12 0:08am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Well, obviously there is no workaround on your request.
As far as your control is hosted in WPF window , so it fully controlling by parent object.
If we look at your problem from interop mechanism , we can conclude that in WPF there is only one HWND (window's handle from WIN32 API terminology) for all childs control, so as a result transparency of your video ctrl is dependant from main Window..
And one more for more compelling words look what MS said:
"OS cannot render any object without having a reference to HWND to its kernel. Hence is the case with WPF. So WPF window actually holds a reference to one window handle. Even you can get Window Handle for any Visual inside the WPF window"

So as a rusult -> Every Visual of WPF does not have its own HANDLE associated with it, rather it is a content for the outside window element, Hence you can say, every WPF control is owned by its parent window.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100