WPF扩展:反转图标方向,同时保持内容的位置(ExpandDirection)相同 [英] WPF Expander: Reversing the icon direction while keeping the content location (ExpandDirection) the same

查看:956
本文介绍了WPF扩展:反转图标方向,同时保持内容的位置(ExpandDirection)相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WPF扩展器就像一个抽屉里,它扩大了出来,让头部保持在内容上方。当它被折叠的网格单元,它在变小为好。

I am using the WPF expander like a drawer, it expands up out so that the header remains above the content. When it is collapsed the grid cell that it is in is made smaller as well.

我要展开方向仍然向下,这样的内容填写下方,但因为它移动起来会更好看,如果方向箭头的图标均相反的方向,如果所述ExandDirection属性被设置为向上。这怎么用C#代码或XAML来完成。

I want the expand direction to remain down so that the content fills in below it, however because it moves up it would look better if the icon with the directional arrow were in the opposite direction as if the ExandDirection property were set to Up. How can this be done in either C# code or in the XAML.

感谢

推荐答案

如果我理解正确的话,你希望交换的扩展崩溃/展开状态的箭头,你需要创建一个扩展自定义的控件模板。
我知道要做到这一点,最简单的方法是从WPF主题得到扩展控制模板,并重新命名方式:

If I understand correctly that you want to swap arrows for expander collapsed/expanded state, you'll need to create a custom control template for expander. The easiest way I know to do that is to get expander control template from wpf theme and rename styles:


  • ExpanderUpHeaderStyle至
    ExpanderDownHeaderStyle

  • ExpanderDownHeaderStyle至
    ExpanderUpHeaderStyle

您可以下载的主题来源从这里
http://msdn.microsoft。 COM / EN-US /库/ aa358533(VS.90)的.aspx

You can download themes sources from here http://msdn.microsoft.com/en-us/library/aa358533(VS.90).aspx

如果你有任何问题,让我知道什么WPF 。主题是您使用我会让你的XAML

If you'll have any issues with that, let me know what wpf theme are you using and I'll make you the xaml.

也看看如何定制与混合
http://www.c-sharpcorner.com/uploadfile/dpatra/807/default.aspx

Also have a look how to customize Expander with Blend http://www.c-sharpcorner.com/uploadfile/dpatra/807/default.aspx

这篇关于WPF扩展:反转图标方向,同时保持内容的位置(ExpandDirection)相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆