当前位置:网站首页>WPF效果第一百九十四篇之伸缩面板
WPF效果第一百九十四篇之伸缩面板
2022-08-09 16:09:00 【dotNET跨平台】
前面一篇玩耍了一下登录实现效果;今天在原来的基础上来玩耍一下伸缩面板的效果;闲话不多扯直接看效果:
1、关于前台简单布局:

2、左侧面板伸缩动画:
<Storyboard x:Key="ShowConfigSb">
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="LeftTreeViewUc">
<EasingThicknessKeyFrame KeyTime="0" Value="-301,0,0,0"/>
<EasingThicknessKeyFrame KeyTime="0:0:0.8" Value="0,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="HideConfigSb">
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="LeftTreeViewUc">
<EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,0"/>
<EasingThicknessKeyFrame KeyTime="0:0:0.8" Value="-301,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
</Storyboard>3、右侧面板伸缩动画:
//展开
<EasingThicknessKeyFrame KeyTime="0:0:0.8" Value="0,0,0,0"/>
//收缩
<EasingThicknessKeyFrame KeyTime="0:0:0.8" Value="0,0,-301,0"/>4、底部面板伸缩动画:
//展开
<EasingThicknessKeyFrame KeyTime="0:0:0.8" Value="-40,0,-40,0"/>
//收缩
<EasingThicknessKeyFrame KeyTime="0:0:0.8" Value="-40,0,-40,-301"/>5、注意的就是布局最外层Grid的属性:
ClipToBounds="True"6、来看看如果不设置会出现什么惊喜:

最终简单的效果先这样吧
;以后有时间的话,可以再去摸索一下更复杂的效果
;编程不息、Bug不止、无Bug、无生活
;改bug的冷静、编码的激情、完成后的喜悦、挖坑的激动 、填坑的兴奋;这也许就是屌丝程序员的乐趣吧;今天就到这里吧;希望自己有动力一步一步坚持下去;生命不息,代码不止;大家抽空可以看看今天分享的效果,有好的意见和想法,可以在留言板随意留言;我看到后会第一时间回复大家,多谢大家的一直默默的关注和支持!如果觉得不错,那就伸出您的小手点个赞并关注一下!
边栏推荐
- LeetCode 131.分割回文串
- Redis 定长队列的探索和实践
- Print the star chart "Recommended Collection"
- 什么是硬件集成开发?硬件集成开发的核心有哪些?
- MySQL索引的B+树到底有多高?
- 期货开户流程和手续费如何调整
- SQL trill interview: send you a universal template, to?(key, each user to log on to the maximum number of consecutive monthly)
- 原油等特殊期货开户要求和豁免
- @AllArgsConstructor and @NoArgsConstructor
- 想通这点,治好 AI 打工人的精神内耗
猜你喜欢

A49 - ESP8266建立AP传输XPT2046AD数据WIFI模块

Video chat source code - how to improve the quality of one-to-one live broadcast?

Vim practical skills_2. Normal mode and insert mode
![[Server data recovery] Data recovery case of file system data loss caused by SAN LUN mapping error](/img/fa/a6d9fdc17dd92f68f876df4a6e3ca6.jpg)
[Server data recovery] Data recovery case of file system data loss caused by SAN LUN mapping error

中科院打脸谷歌:普通电脑追上量子优越性,几小时搞定原本要一万年的计算...
Optimization of a piece of JDBC code (Part 1)

Jenkins使用pipeline部署服务到远程服务器

CryoEM粒子(Particle)类型预测的数据集构建

程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果

Leading practice | How the world's largest wine app uses design sprint to innovate the vivino model
随机推荐
Arrow parquet 之 String Reader
价值10亿美元 美国向乌克兰提供单次最大规模安全援助
【开源教程4】疯壳·开源编队无人机-OPENMV 脚本烧写
LeetCode 413.等差数列划分
生产者-消费者线程模型学习
B48 - 基于51单片机的学生管理门禁系统设计
在 ASP.NET Core 中上传文件
SQL trill interview: send you a universal template, to?(key, each user to log on to the maximum number of consecutive monthly)
期货开户应该了解的行内知识
零基础爬虫regex练习「音乐抓取」
<IDEA 使用小技巧&&常用键联合操作>
MySQL索引的B+树到底有多高?
Redis Cache Expiration and Retirement Policy
B024 – STM32温湿度控制体温检测烟雾报警系统
对象模型-虚指针虚表
What you should know about futures account opening
微信开发者工具程序开发好后,不报错,但是黑屏「建议收藏」
Using Prometheus skillfully to extend the kubernetes scheduler
IDEA启动缓慢原因(一)
图像几何校正