首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏林德熙的博客

    win10 uwp 在 ItemsPanelTemplate 里面通过样式绑定 Orientation 显示方向

    在 UWP 是不支持在 Setter 里面的 Value 进行绑定,如果想要在 ItemsPanelTemplate 里面绑定显示方向,那么需要通过附加属性的方法绑定。 Orientation 绑定到 ListView 的 ItemsPanel 通过一个样式 <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate Orientation="{Binding Orientation, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> </ItemsPanelTemplate Orientation, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> </ItemsPanelTemplate > <ItemsStackPanel /> </ItemsPanelTemplate

    1.1K30发布于 2019-03-19
  • 来自专栏林德熙的博客

    win10 uwp 在 ItemsPanelTemplate 里面通过样式绑定 Orientation 显示方向

    在 UWP 是不支持在 Setter 里面的 Value 进行绑定,如果想要在 ItemsPanelTemplate 里面绑定显示方向,那么需要通过附加属性的方法绑定。 Orientation 绑定到 ListView 的 ItemsPanel 通过一个样式 <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate Orientation="{Binding Orientation, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> </ItemsPanelTemplate Orientation, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> </ItemsPanelTemplate > <ItemsStackPanel /> </ItemsPanelTemplate

    79210编辑于 2022-08-04
  • 来自专栏菩提树下的杨过

    silverlight:ListBox中如何取得DateTemplate/ItemsPanelTemplate中的命名控件?

    class TestData{public string d{set;get;}} } 这里我们借助VisualTreeHelper对指定行(ListBoxItem)做了一个遍历,以查找符合要求的控件 对于ItemsPanelTemplate 中的命名控件,比如下面这样的: <ListBox> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" x:Name="sp"></StackPanel > </ItemsPanelTemplate> <ListBox.ItemTemplate> <DataTemplate> <Rectangle Width="100" Height="100 </ListBox> 如果想在listItem_MouseLeftButtonDown中引用sp,按正统处理方法还真是比较麻烦(各位可以google,baidu印证),这里给出一个很取巧的办法: <<em>ItemsPanelTemplate</em> >         <StackPanel Orientation="Horizontal" x:Name="sp" Loaded="sp_Loaded"></StackPanel> </ItemsPanelTemplate

    1.2K50发布于 2018-01-23
  • 来自专栏全栈程序员必看

    listbox里面添加WrapPanel ,支持自适应换行[通俗易懂]

    listbox大家都会用,如果要让它支持换行操作还必须加上 ListBox.ItemsPanel ItemsPanelTemplate toolkit:WrapPanel/ /ItemsPanelTemplate 这样的后果可能会出现要么全部推在一起,要么要有横向的滚动条 listbox大家都会用,如果要让它支持换行操作还必须加上 <ListBox.ItemsPanel> <ItemsPanelTemplate > <WrapPanel ></WrapPanel> </ItemsPanelTemplate>

    1.6K20编辑于 2022-09-15
  • 来自专栏我的WPF笔记

    记一次自定义基因分类图实现(二)

    ClusterPanel MaxLevel="3" Orientation="Horizontal"></series:ClusterPanel> </ItemsPanelTemplate ElementName=verBorder}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate ClusterPanel MaxLevel="3" Orientation="Vertical"></series:ClusterPanel> </ItemsPanelTemplate "ContentItemsControl"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate <ItemsControl.ItemsPanel> <ItemsPanelTemplate

    21500编辑于 2025-04-26
  • 来自专栏林德熙的博客

    win10 UWP ListView

    可以使用下面代码 <ListView.ItemsPanel> <ItemsPanelTemplate> < StackPanel Orientation="Horizontal"></StackPanel> </ItemsPanelTemplate> < ScrollViewer.VerticalScrollMode="Disabled"> 使用从左到右放元素 实际上 ItemsPanelTemplate 可以放很多个类型,如 WrapGrid 和 ItemsWrapGrid ,下面我告诉大家如何做出这个效果 <ListView.ItemsPanel> <ItemsPanelTemplate <ItemsWrapGrid Orientation="Horizontal"></ItemsWrapGrid> </ItemsPanelTemplate

    1.5K20发布于 2018-09-19
  • 来自专栏林德熙的博客

    WPF 列表自动换行

    可以通过使用 WrapPanel 让控件,如果宽度在 ListView 或 ListBox 之外就换行 <ListView.ItemsPanel> <ItemsPanelTemplate > <WrapPanel Orientation="Horizontal"></WrapPanel> </ItemsPanelTemplate 看起来大概是下面代码 <ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListView.ItemsPanel> <ItemsPanelTemplate > <WrapPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ListView.ItemsPanel> .

    3.7K20编辑于 2022-08-04
  • 来自专栏林德熙的博客

    win10 uwp 动态修改ListView元素布局

    本文告诉大家如何在代码动态修改 ListView 的元素布局,从垂直修改为水平,从水平修改为垂直 先给大家一张图看一下效果 如何需要从 cs 代码修改 ListView 的 ItemsPanel 的 ItemsPanelTemplate <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation="Horizontal "/> </ItemsPanelTemplate> </ListView.ItemsPanel> 因为无法通过后台代码直接创建一个 ItemsPanelTemplate ,除了使用

    76930编辑于 2022-08-04
  • 来自专栏林德熙的博客

    win10 uwp 动态修改ListView元素布局

    如何需要从 cs 代码修改 ListView 的 ItemsPanel 的 ItemsPanelTemplate 从而修改元素布局是比较困难的。 <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation="Horizontal "/> </ItemsPanelTemplate> </ListView.ItemsPanel> 因为无法通过后台代码直接创建一个 ItemsPanelTemplate ,除了使用

    1.3K20发布于 2018-09-18
  • 来自专栏林德熙的博客

    WPF 使用 ItemsPanel 修改方向

    上面代码运行可以看到列表是垂直的 如果需要修改为水平的,可以通过 ItemsPanel 修改 <ListView.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> Source={StaticResource InventoryData}, XPath=Book}"> <ListView.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate>

    83420编辑于 2022-08-04
  • 来自专栏林德熙的博客

    WPF 使用 ItemsPanel 修改方向

    如果需要修改为水平的,可以通过 ItemsPanel 修改 <ListView.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> Source={StaticResource InventoryData}, XPath=Book}"> <ListView.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate>

    1.6K40发布于 2019-03-13
  • 来自专栏Windows Community

    Windows Phone 8.1 新特性 - 控件之列表选择控件

    VariableSizedWrapGrid Orientation="Vertical" Margin="0 0 0 20" ItemHeight="75"/> </ItemsPanelTemplate </GroupStyle> </ListView.GroupStyle> <ListView.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Vertical" /> </ItemsPanelTemplate> DataTemplate> </ListView.ItemTemplate> <ListView.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate>

    1.7K90发布于 2018-04-28
  • 来自专栏菩提树下的杨过

    Silvelright:ListBox无法用Tab顺序切换内部元素焦点的解决

    DataTemplate> </ListBox.ItemTemplate> <ListBox.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Horizontal" Margin="10"/> </ItemsPanelTemplate </telerik:ListBox.ItemTemplate> <telerik:ListBox.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Horizontal" Margin="10"/> </ItemsPanelTemplate

    1.6K100发布于 2018-01-24
  • 来自专栏林德熙的博客

    WPF 列表自动换行

    可以通过使用 WrapPanel 让控件,如果宽度在 ListView 或 ListBox 之外就换行 <ListView.ItemsPanel> <ItemsPanelTemplate > <WrapPanel Orientation="Horizontal"></WrapPanel> </ItemsPanelTemplate 看起来大概是下面代码 <ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListView.ItemsPanel> <ItemsPanelTemplate > <WrapPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ListView.ItemsPanel> .

    4.7K30发布于 2019-03-13
  • 来自专栏林德熙的博客

    WPF 使用 XmlDataProvider 提供数据

    Source={StaticResource InventoryData}, XPath=Book}"> <ListView.ItemsPanel> <ItemsPanelTemplate > <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate>

    1.2K10发布于 2021-03-11
  • 来自专栏张高兴的博客

    张高兴的 UWP 开发笔记:横向 ListView

    --横向布局--> <ItemsPanelTemplate x:Key="HorizontalItemsPanelTemplate"> <VirtualizingStackPanel ScrollViewer.HorizontalScrollMode="Enabled" ScrollViewer.VerticalScrollMode="Disabled"/> </ItemsPanelTemplate --横向布局--> <ItemsPanelTemplate x:Key="HorizontalItemsPanelTemplate"> <VirtualizingStackPanel ScrollViewer.HorizontalScrollMode="Enabled" ScrollViewer.VerticalScrollMode="Disabled"/> </ItemsPanelTemplate

    1.5K70发布于 2018-05-18
  • 来自专栏全栈程序员必看

    WPF之ListView使用WrapPanel

    ListView.ItemTemplate> <ListView.ItemsPanel> <ItemsPanelTemplate <WrapPanel IsItemsHost=”True” Orientation=”Horizontal” /> </ItemsPanelTemplate

    79230编辑于 2022-09-15
  • 来自专栏林德熙的博客

    win10 UWP ListView

    可以使用下面代码 <ListView.ItemsPanel> <ItemsPanelTemplate> < StackPanel Orientation="Horizontal"></StackPanel> </ItemsPanelTemplate> < ScrollViewer.VerticalScrollMode="Disabled"> 使用从左到右放元素 实际上 ItemsPanelTemplate 可以放很多个类型,如 WrapGrid 和 ItemsWrapGrid ,下面我告诉大家如何做出这个效果 <ListView.ItemsPanel> <ItemsPanelTemplate <ItemsWrapGrid Orientation="Horizontal"></ItemsWrapGrid> </ItemsPanelTemplate

    1K10编辑于 2022-08-04
  • 来自专栏技术之路

    silverlight ListBox 多列图片效果

    思路是:        修改ItemTemplate样式        ItemsPanelTemplate 用WrapPanel显示 先为image绑定图片添加一个转换类 using System; ControlTemplate> </Setter.Value> </Setter> </Style> listbox用的时候要把它的ItemsPanelTemplate ItemTemplate="{StaticResource ItemTemplate}"> <ListBox.ItemsPanel> <ItemsPanelTemplate WrapPanel Width="Auto" Background="#F3FFFF" > </tools:WrapPanel> </ItemsPanelTemplate WrapPanel Width="Auto" Background="#F3FFFF" > </tools:WrapPanel> </ItemsPanelTemplate

    1.8K70发布于 2018-01-31
  • 来自专栏DotNet杂记

    WPF旋转板栈设计一例

    ItemsControl ItemsSource="{Binding NestGroups}"> 18 <ItemsControl.ItemsPanel> 19 <ItemsPanelTemplate > 20 <StackPanel Orientation="Horizontal"></StackPanel> 21 </ItemsPanelTemplate {Binding LeftTubes3}"> 30 <ItemsControl.ItemsPanel> 31 <ItemsPanelTemplate > 32 <Canvas/> 33 </ItemsPanelTemplate> 34 " Rows="{Binding Cols}" IsHitTestVisible="False"/> 56 </ItemsPanelTemplate

    28500编辑于 2025-04-13
领券