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.
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.
Comments
Anonymous
June 19, 2008
PingBack from http://blogs.msdn.com/brada/archive/2008/04/25/silverlight-flickr-example.aspxAnonymous
June 19, 2008
Karen Corby on VSM part 2, Jesse Liberty on upcoming Webcasts, a Coffee-break Webcast with Martha RotterAnonymous
June 19, 2008
The comment has been removedAnonymous
June 27, 2008
The last part of webcast series didn't focus specifically on one facet of Silverlight 2, but rather highlightedAnonymous
July 14, 2008
ASPX: 1.任何在Visual Studio平台上开发(人员)必不可少的工具。 http://msdn.microsoft.com/en-us/magazine/cc300778.aspx 2.一个新版本