WPF 简单模仿 VSCode 界面布局
Posted dotNET跨平台
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WPF 简单模仿 VSCode 界面布局相关的知识,希望对你有一定的参考价值。
WPF 简单模仿 VSCode 界面布局
本文经原作者授权以原创方式二次分享,欢迎转载、分享。
WPF 简单模仿 VSCode 界面布局
作者:弈虎-吕女士会翻墙
原文链接: https://github.com/Chen-Lin-Zhao-Wei/WPFLikeVSCode
分享一篇群友这几天自己写的 WPF 简单模仿 VSCode 界面布局。
具体功能也不多,难度也不大,自定义了若干控件实现以上程序:

CusWindow
:自定义窗体,WindowChrome
方案, 用于添加HeaderContent
在标题中显示内容。

FrameTabControl
: 窗体中用于显示主内容的TabContrl
,内部逻辑只增加下拉选中其他选项卡的下拉按钮就没了。

FrameTabItem
:FrameTabControl
的子项,页面的容器。

GroupBoxExtend
:继承GroupBox
并重写样式,增加了AdditionContent
属性。

SideTabControl
:继承TabControl
并重写样式,增加了TabContent.Content
的滑入划出,样式已固定死,无法适应TabStripPlacement
变化,这里请注意,用于左侧边栏,Content
中控件的宽度由ContentLength
控制。

SideTabItem
:继承子TabItem
并重写样式,部分参与触发SideTabControl
的划入划出。

SideTabSizeResiger
:一个Thumb
用于调整SideTabControl
中Content
的呈现宽度。

额外的内容是
TreeView
样式的调整,见Styles.TreeViewer.xaml
。

还有垂直的
Menu
的样式调整 见Styles.VerticalMenu.xaml
。

效果
鸣谢 - 弈虎-吕女士会翻墙
源码地址[1]
博客园[2]
参考资料
[1]
源码地址: https://github.com/Chen-Lin-Zhao-Wei/WPFLikeVSCode
[2]博客园: https://home.cnblogs.com/u/wandia/
以上是关于WPF 简单模仿 VSCode 界面布局的主要内容,如果未能解决你的问题,请参考以下文章