1
CornerRadius 용 XAML의 ListView 스타일을 추가하고 싶습니다. 한 가지 방법이 있지만 내 경우에는 작동하지 않습니다. 이렇게하면됩니다.XAML에서 ListView CornerRadius를 추가하는 방법
<ListView.Style>
<Style TargetType="{x:Type ListView}">
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListView}">
<Border CornerRadius="5">
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<!-- here we go -->
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Pink"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Pink"/>
</Style.Resources>
</Style>
</ListView.Style>
이렇게하면 ItemsSource의 내 데이터가 표시되지 않으므로 내 Listview가 이렇게됩니다.
<ListView x:Name="MenuBarList"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
Height="{Binding MainMenuHeight}"
Width="{Binding MainMenuWidth}"
ItemsSource="{Binding}"
Foreground="White"
Background="#FF3D61D0"
SelectionMode="Single">
어떻게이 스타일을 추가 할 수 있습니까? 감사합니다 .. !!