private bool isFromProfile; //page loaded from profile or not public AdminActivityLog(AdminsPage ap, MainView mv, string id, bool isFromProfile) { InitializeComponent(); this.ap = ap; this.mv = mv; this.id = id; this.isFromProfile = isFromProfile; //hide block button if page is loaded from ProfilePage if (isFromProfile == true) { block_toggle.Visibility = Visibility.Hidden; text2.Visibility = Visibility.Hidden; } }
private void BtnBack_Click_1(object sender, RoutedEventArgs e) { // if page loaded from profile it will back to profile if (isFromProfile == true) { apr = new AdminProfile(id, mv, null); mv.MenuPage.Content = apr; apr.ShowProfileData(id).ConfigureAwait(false); Console.WriteLine("<<<<<<<<<<<<<<<<<<<< From Profilr"); //apr.LoadData().ConfigureAwait(false); } else { // if page loaded from adminspage it will back to adminspage ap = new AdminsPage("", mv); mv.MenuPage.Content = ap; ap.LoadData().ConfigureAwait(false); Console.WriteLine("<<<<<<<<<<<<<<<<<<<< not From Profilr"); } }