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>
相关推荐
月落.6 分钟前
C# 字符串(string)三个不同的处理方法:IsNullOrEmpty、IsInterned 、IsNullOrWhiteSpace
开发语言·c#
Hellc00718 分钟前
如何使用SolidWorks API [C#]
开发语言·数据库·c#
我还有机会吗631 分钟前
C#异步编程
开发语言·c#
purples.3 小时前
word无法复制粘贴
开发语言·c#
阿飞_95273 小时前
WPF 鼠标与触摸屏拖动窗体 窗体拖动功能失灵问题处理
wpf
程序设计实验室3 小时前
PC软件开发新体验!用 Blazor Hybrid 打造简洁高效的视频处理工具
c#·blazor
hello-alien4 小时前
ASP.NetCore---I18n(internationalization)多语言版本的应用
c#·asp.net·i18n·多国语言·语言切换
我与岁月的森林6 小时前
游戏中的对象池技术探索(一)
unity·c#·对象池
IT规划师14 小时前
C#|.net core 基础 - 删除字符串最后一个字符的七大类N种实现方式
c#·.netcore·字符串·字符