title: How do i load my graph when i switch page?
body: <p>Im trying to load a graph that i make using a rand and saving the value's in a array.
  But everytime i load in the page from another page the graph resets from start.
  I first tried to draw the full graph from the array on loading the page but the line's in the graph would be placed wrong.
  Then i thought the problem is the way i go to my plage by making a new one each time like:</p>
  <pre><code>MainFrame.NavigationService.Navigate( new InvestPage());
  </code></pre>
  <p>and then tried doing it like:</p>
  <pre><code>MainFrame.NavigationService.Navigate(new Uri(&quot;/InvestPage.xaml&quot;, UriKind.Relative));
  </code></pre>
  <p>But the graph would still disappear.
  I create the graph using a rand and a timer, here is the function:</p>
  <pre><code>public void InvestTimer1_Tick(object sender, EventArgs e)
  {
      if (InvestArrayIndex1 == 129)
      { 
          Stock1canvas.Children.Clear();
          InvestArrayIndex1 = 1;
          LinemoveForward1 = 3;
      }
  
      InvestArrayIndex1++;
      Globals.RatesInvest1[InvestArrayIndex1] = Globals.RandomNr.Next(0, 99);
  
      Line Invest1Line = new Line();
      Invest1Line.X1 = LinemoveForward1; Invest1Line.Y1 = Globals.RatesInvest1[InvestArrayIndex1];
      Invest1Line.X2 = LinemoveForward1 -3; Invest1Line.Y2 = Globals.RatesInvest1[InvestArrayIndex1 -1];
      Invest1Line.Stroke = new SolidColorBrush(Color.FromArgb(100,83, 113, 219));
      Invest1Line.StrokeThickness = 1;
      Stock1canvas.Children.Add(Invest1Line);
  
      LinemoveForward1 = LinemoveForward1 + 3;
  }            
  </code></pre>