views:

111

answers:

1

Question:

Can a constituent UserControl be transparent in parts for it's external container?

Details:

I have a dialog that I'd like to pull into a separate UserControl. The control contains a Border with a background that has an alpha transparency with a Grid inside it that has a white background and all the content. In xaml markup, it looks something like:

    <Border Margin="22,28,20,18" BorderBrush="Black" BorderThickness="1" Background="#30D7D7D7">
        <Grid Margin="155,148,145,198" Background="#FFFEFEFE">
            <TextBlock Margin="17,19,32,20" Text="Dialog part goes here." TextWrapping="Wrap"/>
        </Grid>
    </Border>

Problem:

When I move that to a user control, even if I set the user control's background to Transparent, it doesn't display a transparent background for the Border; it's solid.

+1  A: 

The UserControl itself will have a background color. Make sure the UserControl you've moved your code to has Background=Transparent.

AnthonyWJones
You were absolutely right here, I should have marked this correct a long time ago.
David in Dakota