Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdating Controls from Multiple Pages on Windows Phone
    text
    copied!<p>All, I am new to Windows 7 Phone. My situation is that I have a main page which contains a <code>ScrollViewer</code> which in turn houses a <code>StackPanel</code>. I want to populate this <code>StackPanel</code> with multiple sub-<code>StackPanel</code>s (at runtime) which are to hold an Image Thumb nail a hyperlink and some basic information about the image. </p> <p>This is all good when I do this from the main page, but I want to know how to update this control (which is on the main page), but from any page other than the main page. I would like to know what is considered best practice for updating a page's control (like that outlined above) from another page.</p> <p>Obviously there are a number of ways to pass data between pages</p> <pre><code>PhoneApplicationService.Current.State["yourparam"] = param NavigationService.Navigate(new Uri("/view/Page.xaml", UriKind.Relative)); </code></pre> <p>then in other page simply</p> <pre><code>var k = PhoneApplicationService.Current.State["yourparam"]; </code></pre> <p>and many others. But <strong>what is best practice for updating a generic control from a different page?</strong></p> <p>Note: There are many question about data access and passing between pages. </p> <ol> <li><a href="https://stackoverflow.com/questions/4953491/wp7-passing-data-from-page-to-page/5980718#5980718">Passing data from page to page</a></li> <li><a href="https://stackoverflow.com/questions/3213354/how-to-pass-the-image-value-in-one-xaml-page-to-another-xaml-page-in-windows-pho">How to pass the image value in one xaml page to another xaml page in windows phone 7?</a></li> <li><a href="https://stackoverflow.com/questions/6517745/passing-image-from-one-page-to-another-windows-phone-7">Passing image from one page to another windows phone 7</a></li> </ol> <p>and more. This is not what I am asking.</p>
 

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