如何为自定义控件的属性生成xamlmarkup ?

时间:2022-09-02 13:20:18

I am developing a custom control library using WPF in VS2010.It is a chart control like System.Windows.Controls.DataVisualization.Charting.Chart.

我正在VS2010中使用WPF开发一个自定义控制库。它是一个像system . window . controls.datavisualiz . charting. chart这样的图表控件。

When the Chart Control provided by MS is dragged from the toolbox and dropped into the VS XAML designer , the xaml markup is generated for the Chart Control, along with the xaml markup for the property ‘Series’(‘Series’ is a content property) of Chart Control.

当MS提供的图表控件从工具箱中拖出并放入VS XAML设计器时,将为图表控件生成XAML标记,并为图表控件的属性“Series”(“Series”是一个内容属性)生成XAML标记。

I was wondering how this is implemented .In another word, how can I generate xamlmarkup with attribute set for properties of a custom control when dragged from the toolbox and dropped into the xaml designer?

我想知道这是如何实现的。换句话说,当从工具箱中拖拽到xaml设计器中时,如何为自定义控件的属性设置xamlmarkup ?

1 个解决方案

#1


0  

You may have to pull down the SDK but here are some links on MSDN to get started:

你可能需要关闭SDK,但是这里有一些关于MSDN的链接可以开始:

#1


0  

You may have to pull down the SDK but here are some links on MSDN to get started:

你可能需要关闭SDK,但是这里有一些关于MSDN的链接可以开始: