Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ListView with rounded corners

Tags:

c#

.net

wpf

I would like to round the corners of the ListView. I have tried to use the Template property, but it seems that I would have to rewrite the entire template. Is there any way to get to the border so that I can set the CornerRadius

like image 712
Justin Pihony Avatar asked Mar 05 '26 14:03

Justin Pihony


1 Answers

ignore the BorderThickness and CornerRadius values , you can set them according to your requirement.

 <ListView>
        <ListView.Template>
            <ControlTemplate>
                <Border CornerRadius="50" BorderThickness="50" BorderBrush="Red">
                    <ItemsPresenter></ItemsPresenter>
                </Border>
            </ControlTemplate>
        </ListView.Template>
        <ListViewItem Content="Harish"/>
        <ListViewItem Content="Harish"/>
        <ListViewItem Content="Harish"/>
        <ListViewItem Content="Harish"/>
    </ListView>

I hope this will help

like image 188
yo chauhan Avatar answered Mar 07 '26 05:03

yo chauhan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!