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>
相关推荐
绿荫阿广1 小时前
互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(五):使用.NET为树莓派开发Wifi配网功能
c#·.net
ou.cs4 小时前
c# :this() 和 :base()区别
开发语言·c#
汪小白JIY7 小时前
【C#】异步和多线程
c#·thread·async·task·threapool
宝桥南山9 小时前
DeepSeek - 尝试一下GitHub Models中的DeepSeek
microsoft·ai·微软·c#·github·.net
code bean11 小时前
【WPF】WPF 项目实战:构建一个可增删、排序的光源类型管理界面(含源码)
wpf
lljss202015 小时前
C# 一个解决方案放一个dll项目,一个dll测试项目 ,调试dll项目的源码
c#
沉到海底去吧Go16 小时前
【图片识别改名】如何批量将图片按图片上文字重命名?自动批量识别图片文字并命名,基于图片文字内容改名,WPF和京东ocr识别的解决方案
ocr·wpf·图片识别改名·图片识别重命名·图片内容改名
lph197216 小时前
自定义事件wpf
wpf
code bean20 小时前
【WPF】从普通 ItemsControl 到支持筛选的 ItemsControl:深入掌握 CollectionViewSource 用法
wpf
ghost1431 天前
C#学习第27天:时间和日期的处理
开发语言·学习·c#