c# - Ling-to-Sql issue when bind SQL to WP8 using WebService -
i have tried create first wp8 application
bind data sql database
. followed this tutorial black page appears
.
as there no listbox in wp8 tools used longlistselector
following:
mainpage.xaml
shell:systemtray.isvisible="true"> <phone:phoneapplicationpage.resources> <datatemplate x:key="toursdatatemplate"> <stackpanel orientation="horizontal"> <textblock margin="10" text="{binding name}"/> </stackpanel> </datatemplate> </phone:phoneapplicationpage.resources> <!--layoutroot root grid page content placed--> <grid x:name="layoutroot" background="transparent"> <grid.columndefinitions> <columndefinition width="9*"/> <columndefinition width="7*"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <phone:longlistselector x:name="mylonglistselectors" itemssource="{binding}" itemtemplate="{staticresource toursdatatemplate}" />
this mainpage.xaml.cs
using phoneapp1.resources; using phoneapp1.toursservicereference1; namespace phoneapp1 { public partial class mainpage : phoneapplicationpage { // constructor public mainpage() { initializecomponent(); // sample code localize applicationbar //buildlocalizedapplicationbar(); } private void phoneapplicationpage_loaded(object sender, routedeventargs e) { toursservicereference1.toursservice1client serviceclient = new toursservicereference1.toursservice1client(); serviceclient.getallklientscompleted += new eventhandler<toursservicereference1.getallklientscompletedeventargs>(serviceclient_getallklientscompleted); serviceclient.getallklientsasync(); } private void serviceclient_getallklientscompleted(object sender, toursservicereference1.getallklientscompletedeventargs e) { if (e.result != null) { mylonglistselectors.itemssource = e.result; } }
in case should provide more information please let me know. hope not receive down-votes quiet low-quality question.
there no sign of error or similar.
thank time.
what expect see exactly?
you doing nothing inside serviceclient_getallklientscompleted
method. list empty not providing data display
private void serviceclient_getallklientscompleted(object sender, toursservicereference1.getallklientscompletedeventargs e) { if (e.result != null) { //set data context of list here } }
Comments
Post a Comment