Creating a WPF Custom Control

前端 未结 2 1938
死守一世寂寞
死守一世寂寞 2021-01-23 23:05

I\'m currently creating a user interface using WPF and would like to display a pie-chart on my window. As far as I can see, this will involve creating a custom control - it is n

相关标签:
2条回答
  • 2021-01-23 23:09

    The WPF Toolkit includes a Chart Control. Since the source code is also available, maybe you can take a look at it to get inspired. I haven't investigate it much but maybe what you seek is already implemented.

    As for Custom Controls in WPF in general, I recommend you get a copy of WPF Control Development Unleashed. I'm about half way through it and I must say it is very good. It explains everything about creating your own controls and how to pick the class you should derive from. The author also explains when not to create your own control and does a great job of turning the most common WPF control like a Slider or a ListBox into a beautiful visual control that looks nothing like the original. For instance, he takes a ListBox and turns it into a radar screen showing boats and submarines correctly positioned, even the sweeping cone hasn't been omitted. I suspect that what you are trying to accomplish can be done using the same kind of trick.

    0 讨论(0)
  • 2021-01-23 23:21

    Checkout wpf toolkit on codeplex. They have chart controls on the roadmap.

    0 讨论(0)
提交回复
热议问题