Dani
Dani

Reputation: 11

WPF Popup control has black background. allowTransparency doesnt work

I have WPF popup control that needs to have transparent background. I set AllowsTransparency="True" but it isn't applied. This is on a desktop application. Applying allowsTransparency from code behind doesn't help also, it actually sets it to false. Does anyone have solution about this? Thanks!

The xaml:

<Popup Name="myPopup"
    StaysOpen="True"
    Placement="Right"
    MinWidth="100"
    MinHeight="100"
    Width="Auto"
    Height="Auto"
    PopupAnimation="Fade"
    **AllowsTransparency="True"**>

 <Border BorderThickness="0" 
    BorderBrush="{x:Static styles:Resources.myBorderBrush}" 
    Background="{StaticResource myBackground}"
    Effect="{StaticResource myShadowEffect}">
    <StackPanel>

Upvotes: 1

Views: 1095

Answers (1)

Martin
Martin

Reputation: 287

verify that your application runs in full trust. According to msdn page for Popup.AllowsTransparency property:

If the AllowsTransparency property is set to true in an application that does not run in full trust, the AllowsTransparency property value is changed to false.

Upvotes: 2

Related Questions