Select to view content in your preferred language

XAML transparency over map.

628
2
09-30-2010 06:58 AM
DouglasGennetten
Deactivated User
I am placing a map legend over the WPF API with this structure:

<ListBox><ListBox.ItemTemplate><Border><StackPanel><WrapPanel> <!--legend parts-->

I want the <ListBox> to have a transparent background and the individual Items in the <Border> to have an opaque background.

I cannot seem to get the ListBox to be transparent.  What do I need to do?

Thanks.
0 Kudos
2 Replies
AliMirzabeigi
Emerging Contributor
Setting ListBox's Background property to Transparent worked for me. Here you can find a very simple XAML for doing this:
<ListBox Width="100" Height="100" Background="Transparent">
   <ListBox.ItemTemplate>
        <DataTemplate>
           <Border>
              <StackPanel>
                  <WrapPanel>
                      <TextBlock Text="{Binding ListBoxItem.Content}" />
                  </WrapPanel>
               </StackPanel>
           </Border>
        </DataTemplate>
   </ListBox.ItemTemplate>
   <ListBox.Items>
        <ListBoxItem Content="Item #1" />
        <ListBoxItem Content="Item #2" />
        <ListBoxItem Content="Item #3" />
   </ListBox.Items>
</ListBox>
0 Kudos
DouglasGennetten
Deactivated User
duh. I had a ListBox style overridding the Background.
0 Kudos