小编mtz*_*406的帖子

更改列表框中selecteditem的样式

我有一个ScrollViewer:

<ScrollViewer Width="160" 
              VerticalScrollBarVisibility="Auto" 
              HorizontalScrollBarVisibility="Hidden" 
              Height="324" Canvas.Top="0" 
              BorderThickness="0" Padding="0">
   <ListBox x:Name="Snapshots" SelectionChanged="Snapshots_SelectionChanged" 
            Padding="0" Background="#FFF0F0F0" 
            BorderBrush="{x:Null}" VerticalAlignment="Top" 
            SelectionMode="Single">
      <ItemsControl.ItemTemplate>
         <DataTemplate>
            <Image Source="{Binding imageSource}" 
                   Margin="5" Stretch="UniformToFill" 
                   Width="120" Opacity="0.2"/>
         </DataTemplate>
      </ItemsControl.ItemTemplate>
      <ItemsControl.ItemsPanel>
         <ItemsPanelTemplate>
            <StackPanel Orientation="Vertical"  
                        VerticalAlignment="Top"  HorizontalAlignment="Center"/>
         </ItemsPanelTemplate>
      </ItemsControl.ItemsPanel>
   </ListBox>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)

我该如何实现这些功能:

  1. 更改所选项目的不透明度(图像).
  2. 更改所选项目的默认边框样式(图像).

silverlight listbox visualstatemanager selecteditemtemplate

3
推荐指数
1
解决办法
6398
查看次数