Search code examples
wpfuser-controlswpf-controlsbrush

how to use both solid brush and imagebrush in listview.background


The problem i have is how to use both the solid brush and imagebrush tags in listview.bakcground? I have set an image as background in listview but i m not able to set any color to the background?

 <ListView.Background>
   <ImageBrush  ImageSource="Images\ViewIcons\cls.png" Opacity="0.05" />
 </ListView.Background>

Solution

  • If you will set the same property i.e Background then later will overwrite the value of former so do it like this

    <Border Background="Red">
            <ListView >
    
            <ListView.Background>
                <ImageBrush  ImageSource="Images\Q3.png" Opacity=".05" />
            </ListView.Background>
            </ListView>
            </Border>
    

    I hope this will give you an idea.