0
如何編輯代碼中某些列表視圖項目的字體重量?例如,我添加了兩行項目,並且想要加粗第一行。這裏是我的.xaml代碼:如何編輯所選列表視圖項目的字體屬性
<ListView x:Name="AInfoLv" FontFamily="Tahoma" FontSize="11" Background="{x:Null}">
<ListView.View>
<GridView>
<GridViewColumn x:Name="LabelColumn" Header="Label" Width="80" DisplayMemberBinding="{Binding Label}" />
<GridViewColumn x:Name="ValueColumn" Header="Value" Width="80" DisplayMemberBinding="{Binding Value}" />
</GridView>
</ListView.View>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="FontSize" Value="11"/> <Setter Property="FontFamily" Value="Tahoma"/> <Setter Property="FontWeight" Value="Normal"/>
</Style>
</ListView.ItemContainerStyle>
</ListView>
而且添加我的項目,如:
public Info()
{
InitializeComponent();
this.AInfoLv.Items.Add(new { Label = "A", Value = "123" });
this.AInfoLv.Items.Add(new { Label = "B", Value = "456" });
}