简体   繁体   English

将文本块添加到自定义wpf控件(来自Codeplex的拼片控件)

[英]Adding a textblock to a custom wpf control (piepiece control from codeplex)

I'm currently building a Surface application where the main navigation is a circular menu. 我目前正在构建一个Surface应用程序,其中主导航为圆形菜单。 For each menu item I'm using a custom control that I found on codeproject.com: 对于每个菜单项,我使用在codeproject.com上找到的自定义控件:

http://www.codeproject.com/KB/WPF/PieChartDataBinding.aspx (PiePiece control) http://www.codeproject.com/KB/WPF/PieChartDataBinding.aspx(PiePiece控件)

The number of submenu items (which is also piepiece controls) comes from a database and thus dynamically loaded. 子菜单项(也是小控件)的数量来自数据库,因此可以动态加载。 What I can't figure out is how I add a textblock to this custom control to display the submenu item text. 我不知道如何在此自定义控件中添加文本块以显示子菜单项文本。 It needs to follow the PiePiece's RotationAngle property to line up correctly. 它需要遵循PiePiece的RotationAngle属性才能正确对齐。

Anyone got a hot-fix for this? 有人为此提供了修补程序吗? I was thinking about adding another dependencyproperty to the piepiece custom control, but that way I can't set the font-family, size etc (can I?) 我当时正在考虑向饼状自定义控件中添加另一个dependencyproperty,但是那样我就无法设置字体系列,大小等(可以吗?)

Any input on this is greatly appreciated! 任何对此的投入,我们将不胜感激! Thanks! 谢谢!

Have you tried using an Adorners , without taking a really close look the PiePiece Control you're using this might solve your problem. 您是否尝试过使用Adorners而不仔细看一下使用的PiePiece Control,这可能会解决您的问题。

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM