2014-02-20 66 views
0

我想在启动时更改列表框中第一个项目的样式。我可以使用什么方法为第一个项目的其他样式更改此代码?更改windows phone中的第一个列表框项目样式

<ListBox x:Name="ListboxNieuws" 
      Width="408" 
      Margin="0,10,-12,0" 
      ItemsSource="{Binding Items}"> 
     <ListBox.ItemTemplate> 
      <DataTemplate> 
       <StackPanel Margin="0,0,0,17" 
          Orientation="Horizontal" 
          Tap="StackPanel_Tap"> 
        <!-- Replace rectangle with image --> 
        <Rectangle Width="100" 
           Height="100" 
           Margin="12,0,9,0"> 
         <Rectangle.Fill> 
          <ImageBrush x:Name="plaatje" ImageSource="{Binding LineImg}" /> 
         </Rectangle.Fill> 
        </Rectangle> 
        <StackPanel Width="311"> 
         <TextBlock x:Name="title" 
            FontSize="30" 
            Text="{Binding LineOne}" 
            TextWrapping="Wrap" /> 
         <Line Stretch="Fill" 
           Stroke="White" 
           X1="0" 
           X2="1" 
           Y1="0" 
           Y2="0" /> 
         <TextBlock x:Name="time" 
            Margin="0,0,12,10" 
            Style="{StaticResource PhoneTextSubtleStyle}" 
            Text="{Binding LineTwo}" /> 
         <Image Width="20" 
           Height="20" 
           Margin="-170,-45,0,0" 
           Source="/PostDateIcon.png" /> 
         <TextBlock x:Name="date" 
            Margin="85,-37,12,10" 
            Style="{StaticResource PhoneTextSubtleStyle}" 
            Text="{Binding LineThree}" /> 
         <TextBlock x:Name="content" 
            Text="{Binding LineContent}" 
            Visibility="Collapsed" /> 
        </StackPanel> 
       </StackPanel> 
      </DataTemplate> 
     </ListBox.ItemTemplate> 
    </ListBox> 

希望你们其中一位能帮助我改变这种风格。

回答

相关问题