i have a mainwindow.xaml that has a navigationview and the other pages like home.xaml settings.xaml etc. the navigation view has a button that opens a dialog for getting user info from api response, when user sends these info to the dialog it sends user values to a model file so i can use it on other pages for getting api responses. now the problem is when user sends its infos through dialog, api responses works perfectly fine and sends these values to other models, lets say i want to use these values on home.xaml and lets say again that i have a variable called user_info and that variable holds data from the api response. now if i want to put this value on a textblock on home page i can put it but i cant see it without changing pages like going to settings and back to home. by the way home page is already opened by default when app is running.
public void SetXAML()
{
textblock.Text = someModel.usr_info;
}
this is the function that i use for writing data to xaml elements. if i put this function into a button click event it changes the elements without changing navigationview pages. but i dont want that i want it when user sends its values from mainWindow.xamls navigationview.
i tried to create a bool variable in model so when api response is 200 this makes that bool variable true from mainwindow.xaml.cs then if i want to use it on home.xaml.cs i used this code
public Home()
{
this.InitializeComponent();
if (someModel.login_auth)
{
SetXAML();
}
}
but still that didnt work without changing pages.