silverlight - <TextBox.Behaviors> and <Button.Behaviors> not working attached property behaviors not found -
the textbox.behavior not working in property , button.behaviors not working properly. please help, me want create list on same page, because working on wp7 app : todo list;
<stackpanel orientation="horizontal"> <textbox name="textboxnewlistname" maxlength="100" height="70" text="{binding newlistname,mode=twoway}" verticalalignment="top" width="400" fontsize="24" inputscope="text" background="#bfffffff" borderbrush="#bfffffff" foreground="black" style="{staticresource taskdescriptiontextboxstyle}"> <textbox.behaviors> <infrastructure:textboxcommand commandbinding=" {binding gotfocuscommand}"/> </textbox.behaviors> </textbox> <button name="buttonnewlist" width="62" horizontalalignment="right" borderthickness="0" padding="0"> <image source="images\add.png" height="35" width="35"/> <button.behaviors> <infrastructure:buttoncommand commandbinding="{binding addnewlistcommand}"/> </button.behaviors> </button> </stackpanel> enter code here using microsoft.phone.controls; using microsoft.practices.prism.commands; using system; using system.diagnostics; using system.windows; using system.windows.controls; using system.windows.controls.primitives; using system.windows.navigation; using todo.infrastructure; using todo.viewmodels; namespace todo { public partial class mainpage : phoneapplicationpage { public const string masterlistfilename = "masterlist.dat"; public mainpage() { this.initializecomponent(); } private void applicationbarmenuitem_about_click(object sender, eventargs e) { mainviewmodel datacontext = base.datacontext mainviewmodel; if (datacontext != null) { datacontext.showaboutpagecommand.execute(); } } private void listboxexistinglists_selectionchanged(object sender, selectionchangedeventargs e) { listviewmodel selecteditem = this.listboxexistinglists.selecteditem listviewmodel; this.listboxexistinglists.selectedindex = -1; if (selecteditem != null) { selecteditem.showlistpivotpagecommand.execute(); } } private void mainpage_destinationpagechanged(object sender, pagechangedeventargs e) { base.navigationservice.navigate(e.destination); } protected override void onnavigatedto(navigationeventargs e) { base.onnavigatedto(e); if (base.datacontext == null) { base.datacontext = new mainviewmodel(); (base.datacontext mainviewmodel).destinationpagechanged += new mainviewmodel.pagechangedeventhandler (this.mainpage_destinationpagechanged); this.listboxexistinglists.datacontext = base.datacontext; } } private void phoneapplicationpage_loaded(object sender, routedeventargs e) { } } }
Comments
Post a Comment