c# UWP - Tiles OnNavigatedTo doesn't keep variables in MainPage
<p>I've just integrated the Tile creation within my application.</p>

<p>The Tiles are created just fine. I set a string parameter to use when the app is launched from the Tile. </p>

<p>in my <strong>Class.xaml.cs</strong> :</p>

<pre><code>            string tileActivationArguments = "test_params";

            SecondaryTile s = new SecondaryTile(name_clean,
                                                                name,
                                                                name,
                                                                tileActivationArguments,
                                                                TileOptions.ShowNameOnLogo,
                                                                logo);


            s.DisplayName = name;
            s.ForegroundText = ForegroundText.Dark;
            bool isPinned = await s.RequestCreateForSelectionAsync(MainPage.GetElementRect((FrameworkElement)sender), Windows.UI.Popups.Placement.Below);
</code></pre>

<p>And it's pinned with succes.</p>

<p>But when I click on the Tile from the startup menu, I arrive on <code>MainPage.OnNavigatedTo</code> and here, the params are existing, and I set them on a local variable.</p>

<p><strong>MainPage.xaml.cs</strong></p>

<pre><code>    private string params;

    protected override async void OnNavigatedTo(NavigationEventArgs e)
    {
        var parametters = e.Parameter as string;
        if (parametters != null &amp;&amp; parametters != "")
        {
          params = parametters ; // WORKS: here params has the good parameter string
           ....
         }
     }
</code></pre>

<p>then, it goes into <strong>MainPage()</strong></p>

<pre><code>    public MainPage()
    {
        this.InitializeComponent();

       // here the params seems to be reset
       Debug.WriteLine(params); // Exception
       // params == null 
    ... 
     }
</code></pre>

<p>Any Ideas ?</p>