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>
相关推荐
Xin_ye1008611 小时前
C# 零基础到精通教程 - 第七章:面向对象编程(入门)——类与对象
开发语言·c#
rockey62711 小时前
AScript异步执行与await关键字
c#·.net·script·eval·expression·异步执行·动态脚本
程序leo源13 小时前
Qt窗口详解
开发语言·数据库·c++·qt·青少年编程·c#
枫叶林FYL13 小时前
项目九:异步高性能爬虫与数据采集中枢 —— 基于 Crawl<sub>4</sub>AI 与 Playwright 的现代化数据采集平台 项目总览
爬虫·python·深度学习·wpf
月巴月巴白勺合鸟月半17 小时前
质本洁来还洁去,强于污淖陷文本
c#
Xin_ye1008618 小时前
C# 零基础到精通教程 - 第八章:面向对象编程(进阶)——继承与多态
开发语言·c#
她说彩礼65万18 小时前
WPF 多值转换器
wpf
asdzx6719 小时前
使用 C# 打印 Excel 文档(详细教程)
c#·excel
伽蓝_游戏21 小时前
第四章:AssetBundle 核心机制与文件结构
unity·c#·游戏引擎·游戏程序
2501_9307077821 小时前
使用C#代码拆分 PowerPoint 演示文稿
开发语言·c#·powerpoint