这个控件最实用的地方,就是做导航栏。

  1. <StackPanel Margin="20,20" Width="100" Height="460" HorizontalAlignment="Left"
  2. VerticalAlignment="Top">
  3. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  4. <Expander.Header>
  5. <TextBlock Text="用户管理" FontSize="14" FontWeight="Bold" />
  6. </Expander.Header>
  7. <Expander.Content>
  8. <Grid>
  9. <Grid.RowDefinitions>
  10. <RowDefinition Height="auto"/>
  11. <RowDefinition Height="auto"/>
  12. </Grid.RowDefinitions>
  13. <RadioButton Grid.Row="0">会员管理</RadioButton>
  14. <RadioButton Grid.Row="1">角色管理</RadioButton>
  15. </Grid>
  16. </Expander.Content>
  17. </Expander>
  18. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  19. <Expander.Header>
  20. <TextBlock Text="文档管理" FontSize="14" FontWeight="Bold" />
  21. </Expander.Header>
  22. <Expander.Content>
  23. <Grid>
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="auto"/>
  26. <RowDefinition Height="auto"/>
  27. <RowDefinition Height="auto"/>
  28. </Grid.RowDefinitions>
  29. <RadioButton Grid.Row="0">部门资料</RadioButton>
  30. <RadioButton Grid.Row="1">员工资料</RadioButton>
  31. <RadioButton Grid.Row="2">职位资料</RadioButton>
  32. </Grid>
  33. </Expander.Content>
  34. </Expander>
  35. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  36. <Expander.Header>
  37. <TextBlock Text="采购管理" FontSize="14" FontWeight="Bold" />
  38. </Expander.Header>
  39. <Expander.Content>
  40. <Grid>
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="auto"/>
  43. <RowDefinition Height="auto"/>
  44. <RowDefinition Height="auto"/>
  45. <RowDefinition Height="auto"/>
  46. <RowDefinition Height="auto"/>
  47. </Grid.RowDefinitions>
  48. <RadioButton Grid.Row="0">采购计划</RadioButton>
  49. <RadioButton Grid.Row="1">需求分析</RadioButton>
  50. <RadioButton Grid.Row="2">采购单</RadioButton>
  51. <RadioButton Grid.Row="3">入库验收</RadioButton>
  52. <RadioButton Grid.Row="4">入库退回</RadioButton>
  53. </Grid>
  54. </Expander.Content>
  55. </Expander>
  56. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  57. <Expander.Header>
  58. <TextBlock Text="供应商" FontSize="14" FontWeight="Bold" />
  59. </Expander.Header>
  60. <Expander.Content>
  61. <Grid>
  62. <Grid.RowDefinitions>
  63. <RowDefinition Height="auto"/>
  64. <RowDefinition Height="auto"/>
  65. <RowDefinition Height="auto"/>
  66. </Grid.RowDefinitions>
  67. <RadioButton Grid.Row="0">基本资料</RadioButton>
  68. <RadioButton Grid.Row="1">往来单位</RadioButton>
  69. <RadioButton Grid.Row="2">上游供应商</RadioButton>
  70. </Grid>
  71. </Expander.Content>
  72. </Expander>
  73. </StackPanel>

另外,通过ExpandDirection属性可控其展开的方向。

  1. <Expander VerticalAlignment="Stretch" ExpandDirection="Right" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  2. ............
  3. </Expander>

继续聊WPF——Expander控件(1)的更多相关文章

  1. 继续聊WPF——Expander控件(2)

    <Window x:Class="Expander_Sample2.Window1" xmlns="http://schemas.microsoft.com/win ...

  2. WPF Expander控件(扩展面板)

    这算是我比较喜欢的一个控件,以前在Winform中也常用类似的.它包装了一块内容,通过单击一个小箭头按钮可以显示或隐藏所包含的内容.在线帮助以及Web页面经常使用这种技术,因为既可以包含大量内容,而又 ...

  3. 继续聊WPF——Thumb控件

    这个控件,真不好介绍,MSDN上也是草草几句,反正就是可以让用户拖动的玩意儿,但是,你会发现,当你在该控件上拖动时,它没有反响,也就是说这个东西默认不做任何操作的,它是赖在那里什么都不干,除非你去踢上 ...

  4. WPF中Expander控件样式,ListBox的样式(带checkbox)恢复

    Expander控件样式: <ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButt ...

  5. 《WPF》Expander控件简单美化

    示例图: Expander控件功能很常见, 一般用于系统左侧的菜单收缩面板. 1.主要的组成 一个头部(header) 和 一个 内容(content) 组成. <Expander Expand ...

  6. 迟到的 WPF 学习 —— 控件

    这一章书中内容比较多而杂,但每个对象的内容又相对简短,所以只挑选里边有代表性的内容做记录. 1. Label 控件:一个基础的简单的 ContentControl,Labe 支持快捷键文本的设置,可以 ...

  7. 在 UWP 中实现 Expander 控件

    WPF 中的 Expander 控件在 Windows 10 SDK 中并不提供,本文主要说明,如何在 UWP 中创建这样一个控件.其效果如下图: 首先,分析该控件需要的一些特性,它应该至少包括如下三 ...

  8. WPF Popup 控件导致被遮挡内容不刷新的原因

    WPF Popup 控件导致被遮挡内容不刷新的原因 周银辉 今天在写一个WPF控件时用到了Popup控件,很郁闷的情况是:当popup关闭时,原来被popup挡住的界面部分不刷新,非要手动刷新一下(比 ...

  9. 创建 WPF 工具箱控件

    创建 WPF 工具箱控件 WPF (Windows Presentation Framework) 工具箱控件模板允许您创建 WPF 控件,会自动添加到 工具箱 安装扩展的安装. 本主题演示如何使用模 ...

随机推荐

  1. ZendFramework2学习笔记 表单过滤、表单验证

    ZF2有非常多内建的Filter和Validator组件,能够方便地对表单数据进行处理. Filter的作用是过滤表单数据.比如,去除一些空格,替换一些敏感词等. Validator的作用是检验表单数 ...

  2. 小米红米1S 电信/联通版 专用TWRP2.8.1.1中文版 (全屏触摸/支持MTP挂载内外置存储)

    转载请注明出处和链接: http://blog.csdn.net/syhost/article/details/39340477 说说中文TWRP的简史:          中文TWRP是本人在201 ...

  3. cocos2dx编译安卓版本号查看C++错误

    首先,在Mac以下相关软件路径,打开"终端",然后输入  pico .bash_profile  回车 export COCOS2DX_ROOT=/Users/bpmacmini0 ...

  4. HTML5开发移动web应用——SAP UI5篇(7)

    SAPUI5中支持利用Component对组件进行封装.想封装一个组件,Component的基本代码例如以下: sap.ui.define([ "sap/ui/core/UIComponen ...

  5. null in JavaScript

    C# String.IsNullOrEmpty Javascript equivalent https://stackoverflow.com/questions/5746947/c-sharp-st ...

  6. golomb哥伦布编码——本质上就是通过0来区分商和余数

    哥伦布编码是一个针对整数的变长编码方式,详细介绍可以看维基百科.这里简单介绍下: 哥伦布编码使用指定的整数 M 把输入的整数分成两部分:商数 q.余数 r. 商数当做一元编码,而余数放在后面做为可缩短 ...

  7. 假脱机服务(SPOOLing service)

    1. 基本含义 SPOOLing 是 Simultaneous Peripheral(外设) Operation On-Line(联机) 的缩写,是关于慢速字符设备(慢速外设,比如打印机)如何与计算机 ...

  8. Python 36 GIL全局解释器锁 、vs自定义互斥锁

    一:GIL全局解释器锁介绍 在CPython中,全局解释器锁(或GIL)是一个互斥锁, 它阻止多个本机线程同时执行Python字节码.译文:之所以需要这个锁, 主要是因为CPython的内存管理不是线 ...

  9. php函数 array_values()

    array_values() 函数返回一个包含给定数组中所有键值的数组,但不保留键名. 提示:被返回的数组将使用数值键,从 0 开始并以 1 递增. $a=array("Name" ...

  10. HTML <!DOCTYPE>标签

    一般一个基本html页面的结构,如下代码所示: <html> <head> <title>我是基本的页面结构</title> </head> ...