this is my class file that contains the variables that i need to save.
public class general { String imagename2; String name; public string getimage() { return imagename2; } public void viewimage(String imagename){ imagename2 = imagename; } }
First I store it in a class file
selected = lbFiles.SelectedItem.ToString(); general item = new general(); item.viewimage(selected); MessageBox.Show(selected); NavigationService.Navigate(new Uri("/View.xaml", UriKind.Relative));
and by the time it gets redirected to another page, when I get its value is null instead of value
public View() { InitializeComponent(); general general = new general(); viewimagename = general.getimage();
I thought and didn’t know why it became zero oO Can someone help me with this? Thanks, I'm in advance !: D
source share