Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF set Stackpanel transparency

$
0
0

         

I need to set the background of a stackPanel transparent.  I have a rotating image that is being displayed full screen. But I need the UserControls I put in the stackpanel to show on top of the rotating images.  This used to work a year or more ago.  The code is the same. What happens depending on what order I place the controls in the xmal I get different results. 

if I have the stackpanels first the images show but I can't see any of the userControls added to the stackPanels

      <customControls:StackingPanel x:Name="panelLeft" Grid.Column="0" ClipToBounds="True" />
        <customControls:StackingPanel x:Name="panelRight"  Grid.Column="2" ClipToBounds="True" />

 <local:AdRotator x:Name="adRotatorPromo" Grid.ColumnSpan="3"  Width="1366"  Height="768" VerticalAlignment="Top" />

if I have the adRotator (custom userControl) first I get white boxes over the images where the stackpanels are and i can see the usreContols added to the stackpanel

  <local:AdRotator x:Name="adRotatorPromo" Grid.ColumnSpan="3"  Width="1366"  Height="768" VerticalAlignment="Top" />

        <customControls:StackingPanel x:Name="panelLeft" Grid.Column="0" ClipToBounds="True" />
        <customControls:StackingPanel x:Name="panelRight"  Grid.Column="2" ClipToBounds="True" />


I have tried setting the stackpanel background to the same and adRotator and that didn't help.<customControls:StackingPanel x:Name="panelLeft" Grid.Column="0" ClipToBounds="True" Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=local:AdRotator}}" /> 

I've tried setting Opacity on the stackpanels but that seems to affect the usercontrols added to it.

Any help would be great,


Viewing all articles
Browse latest Browse all 18858

Trending Articles