Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Phone link from Tile error
    primarykey
    data
    text
    <p>I have a list of theaters and I created a secondary tile from my application to navigate directly to specific theater. I pass the id of the theater in query string :</p> <p>I load the theaters from a WCF service in the file "MainViewModel.cs"</p> <p>In my home page, I have a list of theaters and I can navigate to a details page. </p> <p>But when I want to navigate from the tile, I have an error...</p> <p>The Tile :</p> <pre><code>ShellTile.Create(new Uri("/TheaterDetails.xaml?selectedItem=" + theater.idTheater, UriKind.Relative), tile, false); </code></pre> <p>My TheaterDetails page :</p> <pre><code> public partial class TheaterDetails : PhoneApplicationPage { theater theater = new theater(); public TheaterDetails() { InitializeComponent(); } protected override void OnNavigatedTo(NavigationEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } if (DataContext == null) { string selectedIndex = ""; if (NavigationContext.QueryString.TryGetValue("selectedItem", out selectedIndex)) { int index = int.Parse(selectedIndex); theater = (from t in App.ViewModel.Theaters where t.idTheater == index select t).SingleOrDefault(); DataContext = theater; .... .... .... </code></pre> <p>The error :</p> <p><a href="https://dl.dropboxusercontent.com/u/9197067/error.png" rel="nofollow">https://dl.dropboxusercontent.com/u/9197067/error.png</a></p> <p>Like if the data were not loaded... </p> <p>Do you have an idea where the problem come from ?</p> <p>The solution could be easy but I am a beginner... Maybe it's because I load the data asynchronously and the application doesn't wait until it's done...</p> <p>Thanks</p> <p>EDIT :</p> <p>My LoadData() method :</p> <pre><code> public void LoadData() { client.GetTheatersCompleted += new EventHandler&lt;ServiceReference1.GetTheatersCompletedEventArgs&gt;(client_GetTheatersCompleted); client.GetTheatersAsync(); // Other get methods... this.IsDataLoaded = true; } private void client_GetTheatersCompleted(object sender, ServiceReference1.GetTheatersCompletedEventArgs e) { Theaters = e.Result; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload