Welcome to Pete Brown's 10rem.net

First time here? If you are a developer or are interested in Microsoft tools and technology, please consider subscribing to the latest posts.

You may also be interested in my blog archives, the articles section, or some of my lab projects such as the C64 emulator written in Silverlight.

(hide this)

Silverlight 4 in Action Source Code

Pete Brown - 28 October 2010

I realized I never posted the location of the source code for Silverlight 4 in Action. You can download the source code directly from Manning. Just click on the download link on that page.

posted by Pete Brown on Thursday, October 28, 2010
filed under:      

12 comments for “Silverlight 4 in Action Source Code”

  1. SLNEWBsays:
    I just started with the SL and trying to follow the book "Silverlight 4 in Action" I tried the first
    script snippet and compled it fine. I have the IIS 7 running, but want to know that which file do I need
    to run in order to get the result page for the following URL in the window. Do I have to set up the web site
    in IIS to host the application, the book does not talk about any of this stuff. Also the data from the twitter should be dosplayed in the window of the button is pressed, but it does not seems to work.
    Please let me know,

  2. Petesays:

    I don't go into that in chapter 1 because it "just works" using hte default configuration. Did you load the full solution, or just the silverlight project? It sounds like the latter. The solution should have two projects in it.

    For Silverlight to have access to the web, it must be run from a web site, not the file system. Look at the URL in the browser. If it starts with file:// then you are running from the file system.

    You don't need IIS. The built-in web server in Visual Studio will work just fine.

    1. Ensure you have both a web project and the Silverlight project in the solution.
    2. On the web project, set the <whatever>TestPage.aspx or <whatever>TestPage.html as the startup file.
    3. Run the solution. If the debug settings in the sl project are correct, it will start up the web project and load the page you marked as startup. If the settings are not correct, you can either fix them or set the web project as the startup project. Either way will work for this example.

    If none of that works, right-click the test page (either the aspx or html) in the web project and select "view in browser".

  3. Jeff O'Connellsays:

    I'm 1/2 way through your book and on my way to learn SL4. Good stuff, but I just observed one of your video tutorials on MSDN and really enjoyed the compact nature of everything you fitted into the 33 minute video.
    "Building Your First Silverlight 4 Web Application".

    I liked the way the video tutorial complemented the first 12 chapters of thebook I've already read.

    Question: Do you have any more video tutorials on Silverlight 4? and if so, where can I gain access to these (paid or free access)
    If not, do you have any recommendations on where to go to get quality SL4 videos (except AppDev & PluralSight).

    Let me know.


    Jeff O'Connell
  4. Piet Puksays:
    With the great attention to detail in the book, I had expected a well organized Code repository... instead, for chapter 16 for example, the organization makes no sense.
  5. Petesays:

    I'll take a look at it, but IIRC, the organization follows the chapter build out.

    Was that the only chapter you found issues with, or were there others? I'm working on the next revision of the book, so it's a good time to fix any problems.

  6. Tomaszsays:

    I bought your book and learn SL. The first example will not work correctly. Just like @slnewb wrote. In my case, after clicking on 'Get Tweets' in the output window I get something like this: 'The thread '<No Name>' (0xa80) has exited with code 0 (0x0)' and nothing is displayed in the ListBox

  7. Petesays:

    It has worked for (literally) thousands of other people, so let's try and figure out what's different here.

    1. Did you type in the code or use the downloaded code?

    2. If typed in, did you host the app in a web site on localhost?

    3. If typed in, try the downloaded code and see if that works. If that's the case, then either there's a mistake in the book, or you made a mistake typing it in.

    4. Have you tried to hit the twitter search URL (http://search.twitter.com/search.atom?q=silverlight) directly using your browser? If so, what do you see?

    5. What browser are you using? (I just tested in IE9, Chrome 11.0 and Firefox 4, all on Windows 7 64bit)

  8. Tomaszsays:
    Thank you for your reply. I checked the link in a browser and it worked. I solved this problem. I do not know how but when I downloaded your code and copied it to yourself. Then it worked. When I backed all the changes until the copy has already worked. Strange but already working. Once again, thank you
  9. FlackAttacksays:

    First, I would like to say that I love your book.

    I have a quetsion however on the Presentation Model (POCO / DTO) example in Chapter 17. At the end of your example you use the domainsource control to hook everything up. I was hoping that you could share some light on how to do this through a viewmodel. I am new to SL4 and from what I gathered on your MVVM section is that the VM exposes properties to the View. The problem being however with the presentation model is that you can only expose methods and not properties. I'm sure it is something simple, I just can't figure it out.

    Help please.
  10. Oscarsays:
    I am having trouble openning the source code in manning site. When I download it, it downloads fine, but then I try to open it and it says it is not a zip file. I tried this on two different computers. What gives?
  11. Petesays:

    Unless you're the same person who posted earlier, that makes two people who have run into this.

    I'm not sure what to say. I downloaded it myself to be sure, and it works fine.

    What are you unzipping from (OS and tool)? I've been able to unzip them with 7-zip as well as regular Windows 7 unzip.

    Have you tried re-downloading? I'm not sure where you're located, but it's possible (but not terribly likely) that there's a caching proxy between you and manning it and it had a bad copy.

    Try downloading it fresh (clear your local cache) and let me know if it works or not. If not, I'll see if there's something I can do.


Comment on this Post

Remember me