Click here to Skip to main content
Rate this: bad
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 25-Dec-12 23:08pm

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
0 OriginalGriff 371
1 Sergey Alexandrovich Kryukov 286
2 RyanDev 75
3 PhilLenoir 70
4 Pheonyx 50
0 Sergey Alexandrovich Kryukov 6,676
1 OriginalGriff 6,056
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560

Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2014
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