Animating Windows Phone Listboxes: Listing 1

Loading runtime data from Flickr.

public MainPage()
{
    InitializeComponent();

    Loaded += MainPageLoaded;
}

private void MainPageLoaded(object sender, RoutedEventArgs e)
{
    var wc = new WebClient();
    wc.OpenReadCompleted += FlickrDownloadCompleted;
    wc.OpenReadAsync(new Uri("http://api.flickr.com/services/feeds/photos_public.gne?format=json&nojsoncallback=1"));
}

private void FlickrDownloadCompleted(object sender, OpenReadCompletedEventArgs e)
{
    var serializer = new DataContractJsonSerializer(typeof(FlickrData));
    var data = serializer.ReadObject(e.Result) as FlickrData;

    Dispatcher.BeginInvoke(() =>{
                                    DataContext = data;
                                });
}

About the Author

Nick Randolph runs Built to Roam, a consulting company that specializes in training, mentoring and assisting other companies build mobile applications. With a heritage in rich client applications for both the desktop and a variety of mobile platforms, Nick currently presents, writes and educates on the Windows Phone platform.

comments powered by Disqus

Featured

  • VS Code Keeps Eye on Costs in v1.126 Update

    Visual Studio Code 1.126 adds session-level Copilot cost information, continuing Microsoft's recent focus on helping developers monitor and manage usage-based GitHub Copilot billing.

  • Open VSX 1.0.0 Puts Focus on Open Extension Registry for VS Code Ecosystem

    Eclipse Open VSX has reached 1.0.0, highlighting its role as a vendor-neutral registry for VS Code-compatible extensions.

  • Infragistics Puts MCP Toolchain at Center of Ultimate 26.1

    Infragistics Ultimate 26.1 introduces the Ignite UI Enterprise MCP toolchain for AI-assisted app development across Angular, React, Web Components and Blazor.

  • VS Code 1.125 Adds Copilot Spend Meter After Billing Shock

    VS Code 1.125 adds in-editor visibility into additional Copilot budget usage as GitHub's AI-credit billing model continues to draw developer scrutiny.

Subscribe on YouTube