我想使用CornerRadius = 5来自定义边框的以下Listbox-display属性.任何人都可以帮助我实现它而无需更改以下Xaml代码中的现有datatemplate代码:
<ListBox x:Uid="lst_value" Name="lstValues" Background="Wheat" BorderBrush="Black"
HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="1" Height="100" Width="150"
ItemsSource="{Binding listval}" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Background="{Binding}">
<TextBlock x:Name="txtblk" Foreground="Black" FontSize="10" TextAlignment="Left"
FontWeight="Black" Text="{Binding}" Background="{Binding}"></TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Run Code Online (Sandbox Code Playgroud)