WPF 集合空间绑定,自定义布局

xml 复制代码
<ScrollViewer Height="100" VerticalScrollBarVisibility="Auto">
    <ItemsControl ItemsSource="{Binding TestList}">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <hc:SimpleStackPanel Margin="10,5">
                    <Button
                        Height="80"
                        Background="#DDD"
                        Command="{Binding AddPageCommand}">
                        <hc:SimpleStackPanel Orientation="Vertical">
                            <Image
                                Width="40"
                                Height="40"
                                Margin="0,5"
                                Source="./../WPF/Asset/Image/完整视图.png" />
                            <TextBlock
                                HorizontalAlignment="Center"
                                FontWeight="Bold"
                                Foreground="{StaticResource PrimaryBrush}"
                                Text="111122221" />
                        </hc:SimpleStackPanel>
                    </Button>
                </hc:SimpleStackPanel>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</ScrollViewer>
相关推荐
一刻钟.9 小时前
C#高级语法之线程与任务
开发语言·c#
weixin_3077791310 小时前
C#实现两个DocumentDB实例之间同步数据
开发语言·数据库·c#·云计算
foundbug99910 小时前
基于C#的OPC DA客户端实现源码解析
开发语言·c#
Crazy Struggle11 小时前
.NET 中如何快速实现 List 集合去重?
c#·.net
xb113212 小时前
C#生产者-消费者模式
开发语言·c#
今晚打老虎z12 小时前
解决SQL Server 安装运行时针对宿主机内存不足2GB的场景
sqlserver·c#
Traced back13 小时前
# C# WinForms 数据库清理系统基础知识与避坑指南
开发语言·数据库·c#
我要打打代码15 小时前
关于C#线程 任务
开发语言·数据库·c#
Traced back16 小时前
# C# 基础语法完全指南
开发语言·c#
大黄说说16 小时前
TensorRTSharp 实战指南:用 C# 驱动 GPU,实现毫秒级 AI 推理
开发语言·人工智能·c#