Thursday, June 21, 2007

How to specify which property of my custom class should take the Content from xaml?

Use System.Windows.Markup.ContentProperty attribut on the class
If you are creating a custom class for clock control and wanna Time to take the Content from xaml use as follows.

public class Clock : Control {
public DateTime Time{

Hence the xaml looks like

<MyControl:Clock >
</MyControl:Clock >

No comments:

Post a Comment