当前位置:网站首页>WPF效果之Expander+ListBox
WPF效果之Expander+ListBox
2022-06-23 22:18:00 【Phil Arist】
先来看最终实现的效果:

1、关于简单的布局设计:
总结:①③是Expander②④⑤⑥是ListBox
2、把上一篇的②这一块用ListBox替换:
<Expander Grid.Column="1" ExpandDirection="Left" Header="控制卡"
VerticalAlignment="Bottom" HorizontalAlignment="Right"
Style="{DynamicResource LeftExpanderStyle}" Background="Transparent">
<ListBox Style="{StaticResource SignalCardListBox}" ItemsSource="{Binding VideoCard.SignalDistributionCards}"/>
</Expander>3、然后就是最爱的ItemContainerStyle:
<Style x:Key="SignalCardListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="#282BFF"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="4,4,4,0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Expander Header="信号分配卡" Style="{DynamicResource ExpanderStyle}" VerticalAlignment="Bottom" Padding="0">
<ListBox Style="{StaticResource BoxBodyListListBox}" ItemsSource="{Binding BoxBodys}"/>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>4、ListBox的ItemsPanel:
<ItemsPanelTemplate x:Key="SignalCardItemsPanelTemplate">
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>5、至于⑤⑥的ListBox就没什么可说的了:
最终简单的效果先这样吧

以后有时间的话,可以再去摸索一下更复杂的效果;编程不息、Bug不止、无Bug、无生活;改bug的冷静、编码的激情、完成后的喜悦、挖坑的激动 、填坑的兴奋;这也许就是程序员的乐趣吧;今天就到这里吧;希望自己有动力一步一步坚持下去;生命不息,代码不止;大家抽空可以看看今天分享的效果,有好的意见和想法,可以在留言板随意留言;我看到后会第一时间回复大家,多谢大家的一直默默的关注和支持!如果觉得不错,那就伸出您的小手点个赞并关注一下,多谢您的支持!
边栏推荐
- ACM. Hj89 24 point operation ●●●
- 完整开源项目之诗词吧 APP
- Inftnews | where should the future of the creator economy go in the Web3 world?
- Simple understanding of responsive programming
- List<? extends T>和List<?super T>区别
- What is the production process of enterprise website? How long does it take to design and build a website?
- log Network Execution Time
- B2B transaction management system of electronic components industry: improve the data-based driving ability and promote the growth of enterprise sales performance
- Preliminary understanding of 3D printing and laser cutting process
- 一款高仿腾讯漫画的漫画阅读类 APP
猜你喜欢

Golang 类型断言

Docker redis cluster configuration

AUTOCAD——总结CAD画圆角的三种方式

ORB_ Slam3 environment setup and demo demonstration

网站ssl证书
![The input parameter is object, but it was passed as [object object] because it needs to be converted to JSON format](/img/8c/b1535e03900d71b075f73f80030064.png)
The input parameter is object, but it was passed as [object object] because it needs to be converted to JSON format

高仿書旗小說 Flutter 版,學起來

List中subList的add造成的死循环

一个人竟然撸了一个网易云音乐云村

Taylor formula and common expansion
随机推荐
Improvement of DC power distribution with open hall current sensor
日化用品行业集团采购管理系统改变传统采购模式,降低采购成本
19 MySQL optimizations commonly used in projects
log Network Execution Time
再来一个高仿开眼的短视频APP
Solve the problem that slf4j logs are not printed
This high imitation millet mall project is amazing
【Try to Hack】masscan
Application of acrel-3000web power management system in Duba Expressway
Facebook 开源微光效果 Shimmer
图扑软件智慧风电:数字孪生 3D 风机智能设备运维
Preliminary understanding of 3D printing and laser cutting process
产线工控安全有什么好的解决方案
One person even broke up a Netease cloud music Cloud Village
接私活必备的 6 个开源项目
点乘和叉乘
2022 information security engineer examination knowledge point: access control
Acrel-3000WEB电能管理系统在都巴高速的应用
Visual explanation of clockwise inner curve in Green's formula hole digging method
这个高仿小米商城项目太惊艳了