【发布时间】:2018-11-30 01:04:32
【问题描述】:
我实现了 Listview 的照片预览。
<xctk:MaterialListBox InkEffectBrush="CornflowerBlue" IsInkEffectActive="True" Background="Transparent" x:Name="TvBox" ScrollBar.Scroll="TvBox_Scroll" ScrollViewer.ScrollChanged="TvBox_ScrollChanged" GiveFeedback="TvBox_GiveFeedback" AllowDrop="False" PreviewMouseLeftButtonDown="TvBox_PreviewMouseLeftButtonDown" PreviewMouseMove="TvBox_PreviewMouseMove" Margin="0,0,0,10" HorizontalAlignment="Stretch">
<xctk:MaterialListBox.ItemContainerStyle>
<Style TargetType="{x:Type xctk:MaterialListBoxItem}">
<Setter Property="Height" Value="100" />
<Setter Property="VerticalAlignment" Value="Top" />
</Style>
</xctk:MaterialListBox.ItemContainerStyle>
<xctk:MaterialListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="4" Background="#00FFFFFF"/>
</ItemsPanelTemplate>
</xctk:MaterialListBox.ItemsPanel>
<xctk:MaterialListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" >
<Image Height="100" Width="200" Source="{Binding ImageData}" Stretch="Uniform" />
<xctk:MaterialCheckBox Background="BlueViolet" Content="Выбрать" Click="MaterialButton_Click" HorizontalAlignment="Center" Height="35" Margin="0,20" Width="130"/>
</StackPanel>
</DataTemplate>
</xctk:MaterialListBox.ItemTemplate>
</xctk:MaterialListBox>
【问题讨论】:
-
是否涉及
MaterialDesign -
@satish-pai 我将 Xceed Toolkit Plus 用于 WPF,但使用通常的复选框的实现也适合。谢谢。
-
检查我的回答是否符合你的要求。