I have an AppBar with a button that launches a popup that contains a list that the user selects and upon one being selected it refreshes the page, but before it refreshes for a certain page I need it to execute a task. The code works great on my other pages. I just need it to execute
await home.DatabaseTest();
before it refreshes the page and I only want it to execute if the current page is Dashboard
private async void customerNamePopUp_Tapped_1(object sender, TappedRoutedEventArgs e)
{
//Gets the selected Customer Name and stores it in the Database.
barCustomerName = db.selectCustomerNumberByCustomerName(customerNamePopUp.SelectedItem);
rh.appDataHandler(customerNamePopUp.SelectedIndex, barCustomerName);
if ("WHAT DO I PUT HERE TO 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 the await task to know what I am asking for.
Thank you
I figured it out.
if (Frame1.Content.GetType() == typeof(Dashboard))
{
await home.DatabaseTest();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.