.net - Passing Data Between Different Navigation Pages in WPF C# application and Representation -


i'm unclear how control shifts between 2 pages when navigating in wpf application. i'm trying achieve have database tables, in 1 of tables have names , represent these names in listbox on first page. when user clicks 1 name , presses button below listbox navigates user detailed information clicked user( choosen list )

now problem tutorial i'm following this , problem starts binding data control.

  1. the tutorial follows static <xaml> datasource , have data in database.
  2. after click on 1 user this how i'm supposed show next page, in case selected item not <person></person> block of data obtained querying database itself.
  3. so cannot find resource addresses issue beginners.
  4. as can see data extracted on expanseithome.xaml.cs

:

private void button_click(object sender, routedeventargs e) {     // view expense report     expensereportpage expensereportpage = new expensereportpage(this.peoplelistbox.selecteditem);     this.navigationservice.navigate(expensereportpage); } 

page , passed context constructor

public expensereportpage(object data):this() {     // bind expense report data.     this.datacontext = data; } 

of expanseitreportpage.xaml.cs how implement when interacting database , list names( listbox ) items fetched database not xml source.

  1. i'm web-developing background, can pass value of selected item expanseitreportpage , perform query on same page , present reports selected user or have go way described in tutorial work done expanseithome.xaml.cs page (page names ) , data passed report page presentation.

  2. to plain mean need tutorial or demo me understanding how create multipage wpf application database. (ex. contact book application main page list of names , on clicking these names takes new page containing address , other contact related info )

please feel free provide resources addresses creating database based wpf application in c# includes navigating between different pages while querying database scenarios 1 described above.

thanks


Comments