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; }
}
精彩评论