Amazon.com Widgets

Updated Silverlight FlickR demo for Beta2

I had a little time while traveling to South Africa so I thought I'd update my Silverlight FlickR demo to Beta2. 

 

image

Download the full solution read the full writeup

 

(note: in the application, you can click on the image to advance to the next one)

 

Overall, the changes were pretty minor, the most  interesting one was a change in the way Isolated Storage is accessed.  

I set up a page level variable called appsettings:

IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;

 

Then, when the page is loaded, I initialized based on it.

public Page() {
    InitializeComponent();
    if (appSettings.Contains("searchTerm"))
    {
        this.searchTermTextBox.Text = (string)appSettings["searchTerm"];
      
    }
    if (appSettings.Contains("imageNumber"))
    {
        ImageNumber = (int)appSettings["imageNumber"];
    }
}

Then, at the right time in the application flow, I save data to it

 

private void searchResultsImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (Photos == null) return;
     if (ImageNumber >= Photos.Count()) ImageNumber = 0;

     FlickRPhoto p = Photos.Skip(ImageNumber).First();
     this.searchResultsImage.Source = new BitmapImage(new Uri (p.ImageUrl));

     appSettings["imageNumber"] = ImageNumber;
     appSettings.Save();

     ImageNumber++;

 }

Notice, I also use Corrina's updated "Flat" style for SL beta2 as well, while the style structure changed a lot to take advantage of the new Visual State Manager, the changes to my code were minimal. 

Published 19 June 08 06:53 by BradA
Filed under:

Comments

# Brad Abrams : Silverlight FlickR Example said on June 19, 2008 9:56 AM:

PingBack from http://blogs.msdn.com/brada/archive/2008/04/25/silverlight-flickr-example.aspx

# Community Blogs said on June 19, 2008 4:45 PM:

Karen Corby on VSM part 2, Jesse Liberty on upcoming Webcasts, a Coffee-break Webcast with Martha Rotter

# Lamin Barrow said on June 19, 2008 6:20 PM:

I have not gone around to creating anything in silverlight  beta 2 but i will think of something.  

One more thing.. How come south Africa is the only country in Africa that get's attention when it comes to technology? They even get to host Tech Ed. I think that's very not fair. I live in The Gambia and  I speak .Net and most of it's related technologies too including the new ASP.NET MVC framework but i am probably the only one who

could down here and compared to south Africa... well. May be thats why they get everything.

# Lindsay's Blog O' Stuff v1.9 said on June 27, 2008 7:30 PM:

The last part of webcast series didn't focus specifically on one facet of Silverlight 2, but rather highlighted

# cnblogs.com said on July 14, 2008 8:26 PM:

ASPX: 1.任何在Visual Studio平台上开发(人员)必不可少的工具。 http://msdn.microsoft.com/en-us/magazine/cc300778.aspx 2.一个新版本

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker