properties - Silverlight: How do i assign a usercontrol's property value to a textbox? -


i have user control have added outer form in silverlight. user control has textbox called txtroletitle, have declared property in usercontrol's class called lablename , assigned txtroletitle.text labelname shown in code below bellow, in silverlight property panel, under miscellaneous menu, have set labelname "landlord", added 1 of user control outerform , set labelname tenant. not seem work when run silverlight dialogue. value of labelname not appear in textbox during design , run time.

here code below. thanks

public partial class userroledetails : usercontrol {     public string labelname { get; set; }      public userroledetails()     {         initializecomponent();          this.txtroletitle.text = labelname;     } 

}

you setting value of txtroletitle.text in constructor, @ point of assignment labelname property not have value.

i think need @ making labelname dependency property , binding txtroletitle control in user control's xaml. take @ example : http://stevenhollidge.blogspot.co.uk/2012/03/dependency-properties-in-user-control.html


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -