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>
相关推荐
2501_930707783 小时前
使用C#代码使用条件格式为 Excel 隔行设置颜色
c#·excel
何以解忧唯有撸码6 小时前
【开源】c#造个轮子-日程安排工具
c#·自定义控件
周杰伦fans6 小时前
CAD菜单栏和工具栏都不见了,怎么显示?
其他·c#
曹牧6 小时前
C#:HashSet<T> 去重
c#
czhc11400756636 小时前
起点、口径与因果:今天用错的七把尺子
c#
c#上位机20 小时前
C#上位机项目实战——Task.Run执行带参数的方法
c#·上位机
Lost of 程序猿1 天前
用 YARP 为 .NET 微服务搭一座“立交桥“:路由转发与生产配置实践
c#·asp.net
点纭1 天前
C 语言 第七章 常用函数(3)
c语言·开发语言·算法·oracle·c#
用户788477316341 天前
用 .NET MAUI 一套 C# 同时出 Windows 和 Android:哪些是真能共享,哪些是 marketing
c#
dalong101 天前
WPF:Modbus 状态监控
wpf·modbus