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>
相关推荐
专注VB编程开发20年9 小时前
AI 生成C# WinForm 窗体 = 目前就是垃圾
开发语言·人工智能·c#
z落落10 小时前
C# 泛型接口和泛型类+泛型约束
开发语言·c#
阿正的梦工坊10 小时前
【Rust】08-集合类型、字符串与迭代器入门
开发语言·rust·c#
FuckPatience10 小时前
C# 使用泛型协变将派生类类型替换为基类类型
开发语言·c#
guygg8810 小时前
C# 生成中间带 Logo 头像的二维码
开发语言·c#
Java面试题总结11 小时前
C#12 中的 Using Alias
开发语言·windows·c#
加号311 小时前
【C#】 ASCII 码转字符串技术解析
开发语言·c#
2601_9618752412 小时前
高考真题word版下载|2025高考全科真题可编辑文档
c#·word·ar·vr·mr·高考·oneflow
阿正的梦工坊14 小时前
【Rust】09-泛型、Trait 与生命周期基础
开发语言·rust·c#
z落落14 小时前
C# 事件(Event)+自定义带参数事件例子
开发语言·分布式·c#