title: Storing String in a variable in a class file
body: <p>This is my class file which contains variables which I need to store.</p>
  <pre><code>public class general
  {
      String imagename2;
      String name;
      public string getimage()
      {
          return imagename2;
      }
  
      public void viewimage(String imagename){
          imagename2 = imagename;
      }
  }
  </code></pre>
  <p>I firstly store it to the class file</p>
  <pre><code>selected = lbFiles.SelectedItem.ToString();
  general item = new general();
  item.viewimage(selected);
  MessageBox.Show(selected);
  NavigationService.Navigate(new Uri(&quot;/View.xaml&quot;, UriKind.Relative));
  </code></pre>
  <p>And by the time it redirect to another page, when I retrieve, its null instead of the value</p>
  <pre><code>public View()
  {
      InitializeComponent();
      general general = new general(); 
      viewimagename = general.getimage(); // NULL HERE!!!!!!!!!!!!!!!!!!!!!
  
      this.ReadFromIsolatedStorage(viewimagename+&quot;.jpg&quot;);
     // LoadFromLocalStorage();
  }
  </code></pre>
  <p>I've been thinking and not sure why it became null.</p>