开发者

Expression Blend: How to create User Control with dynamic headline?

I created a UserControl and added a "label" asset. I gave this label a default content property. If I include this UserControl in my projekt, how开发者_C百科 can I achieve to edit the content property in the properties window? I want to have a behaviour like the TabItem: There is a "Header" option under Properties->CommonProperties where you can define your own header.

Any ideas? Cheers!


In your UserControl codebehind class MyUserControl.cs you'll need to add a public property and you're done, the property will be visible and editable via Expression Blend attributes panel.

public string MyProperty {  
    get { return this.label.Text;}  
    set { this.label.Text = value; } 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜