Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
615
How to make DataTemplate background transparent?
posted

I have a data template for a tooltip. Inside the data template, I have a border with rounded corners and shadow effect. I want the surround area to be transparent, but somehow the date template background is black. How can I change this to transparent?

Attached is a screen capture of what the tool tip looks like with the black background.

Here's the code for the data template:

<DataTemplate x:Key="tooltipTemplate">
            <Grid Background="Transparent">
                <Border BorderBrush="Gray" BorderThickness="1"  
                    CornerRadius="5" Background="White"
                    IsHitTestVisible="False"  
                    Padding="5"
                    Margin="10">
                <ItemsControl ItemsSource="{Binding}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Visibility="{Binding Series.Visibility}" >
                                <TextBlock Name="title" Text="{Binding Series.Title}" />
                                <TextBlock Text=": " />
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Item.Value}" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text=" Sample Time: " />
                                    <TextBlock Text="{Binding Item.Key}" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Border></Grid>
        </DataTemplate>

Parents Reply Children
No Data