Hi there,
I was just wondering about something, i have a frame that loads pages and currently each page has a Page_Loaded method that will run each time the page is accessed. This is working great but i am noticing errors if i use the navigation to go to previously visited pages. Upon returning to a page; Page_Loaded is being called again which i do not want.
Using debugging i noticed that InitializeComponent was only getting called the first time the page is implemented and wondered if could simply put my Page_Loaded code after this call like so:
public partial class MyPage: Page
{
public MyPage()
{
InitializeComponent();
//======> To Here
}
private void Page_Loaded(object sender, RoutedEventArgs e)
{
//Put Code from here <======
}
This would solve my problem but is a bad practice? and if so what problems might i encounter down the road?
Thanks, Kohan