c# - Determine Current Page -
i have appbar button launches popup contains list user selects , upon 1 being selected refreshes page, before refreshes page need execute task. code works great on other pages. need execute
await home.databasetest();
before refreshes page , want execute if current page dashboard
private async void customernamepopup_tapped_1(object sender, tappedroutedeventargs e) { //gets selected customer name , stores in database. barcustomername = db.selectcustomernumberbycustomername(customernamepopup.selecteditem); rh.appdatahandler(customernamepopup.selectedindex, barcustomername); if ("what put here test if page equals dashboard") { await home.databasetest(); } if (this.frame != null) { //refreshes current page frame1.navigate(frame1.content.gettype(), rootpage); } }
see note in loop before await task know asking for.
thank you
- create public enum each item correlates each page.
- on app page create static property of enum created signify current page.
- on each page's onnavigatedto method set app static property page's enum.
- wherever needed check variable current page.
Comments
Post a Comment