Downloads and Samples

It’s getting a bit hard to find the most recent versions of my samples and downloads
within my blog, so I thought I’d create a separate page just to summarize. I’m sure
this list will grow over time, and hopefully it’ll help keep things organized.

39 thoughts on “Downloads and Samples”

  1. Just a note to thank you for taking the time to document your exploration. Your examples are spot on relative to the needs I have in my work. I have been looking for ways to use Silverlight as the total framework and you seem to be blazing down a trail right in front of me. Again, thanks, danny

  2. Great work David.I saw other day in scott morrison mix10 talk that ria services will have some kind of authentication in the navigation framework, is that correct? or maybe i’m wrong, we said that would be possible for example to redirect the user to a default login page. just wondering if we have it already in the last bits.


  3. Hi David, i’m using your navigation project.

    I ‘ve met a problem : i got a menu where each menuItem send to another xap.

    I got 3 xap in addition of the shell xap (the one loaded at the beginning)

    When i load the module 1, it works, then i move the second xap, it works too, then i move on the third it’s still good.

    But when i try to move to the second xap another time, i get an error :
    à System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
    à _ContentLoaders.MEF.MEFContentLoader.Loader.NavigateToPage(Uri targetUri)
    à _ContentLoaders.MEF.MEFContentLoader.Loader.c__DisplayClass5.b__0(Object s, AsyncCompletedEventArgs e)
    à System.ComponentModel.Composition.Hosting.DeploymentCatalog.OnDownloadCompleted(AsyncCompletedEventArgs e)
    à System.ComponentModel.Composition.Hosting.DeploymentCatalog.HandleOpenReadCompleted(Object sender, OpenReadCompletedEventArgs e)
    à System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
    à System.Net.WebClient.OpenReadOperationCompleted(Object arg)

    See error.png

  4. Hi David,

    I downloaded your Slab 0.9 project but when I try to compile I get 245 errors.

    Could you please shed some light on the best way to compile it? Do you have any instructions on how to get the solution to work?

    I am using Silverlight 4 and VS 2010 release.



  5. Firstly, let me say thank you so much for sharing your work with everyone.

    I did however run into a little problem when using your SLaB loader. For some reason adding a reference to the System.Windows.Controls.Data.DataForm.Toolkit.dll breaks my loader, but the problem is actually at the WebClient level. The WebClient refuses to load the Xap if the dll is presentent???

    Anyway – the error is ‘No parameterless constructor defined’ which is way way out. The error being caused at the level where the WebClient is actually loading the is swallowed up by the loading framework – so you would never never know the real error.

    public IAsyncResult BeginLoadXap(Uri uri, AsyncCallback callback, object asyncState)
    WebClient wc = new WebClient();
    XapAsyncResult result = new XapAsyncResult(asyncState);
    wc.OpenReadCompleted += (sender, args) =>
    if (args.Error != null)
    throw args.Error;

    It would be really useful if this error bubbled it’s way all the way up to the UI. I always enjoy looking through other peoples code – and the code here is beautiful, but sometimes when you’ve got a client on your back waiting for results and things are going quite as planned, you don’t have the time to hunt down why things aren’t working.

    Again, many thanks for sharing your code. Keep up the fine work 🙂


    1. SLaB is about as open as it gets — I’ve put it out there under Ms-PL, and you’re more than welcome to use it as you see fit. Please remember, however, that I make no guarantees about it behaving correctly, supporting it, etc. Nonetheless, you’re welcome to go use/modify/distribute the code as you see fit :).

  6. Hi David,

    I was wondering if it would be possible to modify the Allow and Deny authorization rule to match against a RegEx pattern for matching roles and users? Would making this change potentially break anything in the content loader?



    1. In principle, it shouldn’t do anything bad/scary. I also thought about doing this, but ultimately decided to do simple string matching to simplify the syntax. You’re welcome to make modifications (and for that matter, though it’s been a long time since I looked carefully at that code, I think I provided extensibility through an interface for rules, so you can make your AllowRegex/DenyRegex if you want :))

  7. Hi David,

    What is the best way I can change the xmlns:SLaB namespace reference on the MainPage.xaml to a local reference. I have put a lot of work getting my application working with your ContentLoader solution but I have just realized it has a dependency on your website being up. Can you help me please?


    1. Shane,

      There is no such dependency. The “xmlns:SLaB” reference is to an arbitrary string — it’s defined locally in the assemblies themselves and does not rely on my website being up. I could just have easily have made it “xmlns:SLaB=’'”, and it likewise would have no dependency on that site’s existence. The Uri there is just an alias to the set of CLR namespaces defined in the SLaB assemblies. I had to choose something, so I chose a Uri that corresponds with my website — there’s no online magic there 🙂


  8. Hi David,

    I tried to use your UiXamlSerializer from SLaB.Utilities.Xaml.Serializer.Phone.dll and SLaB.Utilities.Xaml.Serializer.UI.Phone.dll from SLaBv0.11 for Windows Phone 7 application, but any simple XAML object, such I serialized, throw me InvalidOperationException like “The Writer is closed or in error state”.




    UiXamlSerializer uxs = new UiXamlSerializer();
    string s = uxs.Serialize(button); //throw Exception

    Libraries SLaB.Utilities.Xaml.Serializer.dll and SLaB.Utilities.Xaml.Serializer.UI.dll from SLaBv0.11work very well at the same code in Silverlight application.
    Does UiXamlSerializer work also for Windows Phone 7? Could you kindly clarify this for me?


    1. UiXamlSerializer is less tested for WP7 — I may revisit it at some point (among other things, there are missing behaviors in WP7 that make it impossible to serialize things like Paths, etc. from 3rd party code). The regular XamlSerializer, on the other hand, should work fine.

  9. Very interesting topic.SLaB.Utilities.Xaml.Serializer.UI.Phone.dll from SLaBv0.11 for Windows Phone 7 application, but any simple XAML object, such I serialized, throw me InvalidOperationException like “The Writer is closed or in error state”.

  10. Hi David,

    I downloaded your solution 0.11, unzipped it and then tried to do a build all in Debug mode and I keep getting this error: (I have the latest silverlight toolkit installed).

    Error 246 The “CreateExtmap” task could not be instantiated from “C:\Documents and Settings\ngrubb\Desktop\SLaB\Source\SLaB.Controls.Remote\../../Build Utils/CreateExtmap.exe”. Could not load file or assembly ‘file:///C:\Documents and Settings\ngrubb\Desktop\SLaB\Build Utils\CreateExtmap.exe’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) C:\Documents and Settings\ngrubb\Desktop\SLaB\Source\SLaB.Controls.Remote\SLaB.Controls.Remote.csproj 103 5 SLaB.Controls.Remote

    The CreateExtmap.exe looks to be in the right spot, but I don’t know what is happening to be able to debug this further. What does CreateExtmap.exe do and where is it referenced? I would really like to use your printing library as it looks to solve problems with margins that I’m running into, but am unable to even run your demo projects.

  11. firstly, thanks for making your work available to the public.

    I’m having “slowness” issues with UiXamlSerializer
    my resulting xaml string is usually between 1000 to 2000 characters, and represents a basic stackpanel housing some textboxes.

    each time I serialize it takes over 1 second to perform the command, so a loop of results can get lengthy.

    i’m referencing the binaries you provided, I did not copy the source code since my silverlight 4 project is in VB.

    is this normal?

  12. I don’t know why but when I use your collection printer, the app crashes and IE or Chrome needs to close (see below)
    Nom d’événement de problème: APPCRASH
    Nom de l’application: IEXPLORE.EXE
    Version de l’application: 8.0.7600.16700
    Horodatage de l’application: 4cd23213
    Nom du module par défaut: ntdll.dll
    Version du module par défaut: 6.1.7600.16385
    Horodateur du module par défaut: 4a5bdadb
    Code de l’exception: c0000005
    Décalage de l’exception: 0005205b
    Version du système: 6.1.7600.
    Identificateur de paramètres régionaux: 1036
    Information supplémentaire n° 1: 0a9e
    Information supplémentaire n° 2: 0a9e372d3b4ad19135b953a78882e789
    Information supplémentaire n° 3: 0a9e
    Information supplémentaire n° 4: 0a9e372d3b4ad19135b953a78882e789

    Any clue ?????
    I need “collection printer” !!!!!!!!!!

  13. Hi David,

    Could you build SLaB for Silverlight 5 please?
    Best regards,
    Yongqing Huang
    There is error when I upgraded my project to Silverlight 5

    Error 43 The tag ‘AuthContentLoader’ does not exist in XML namespace ‘clr-namespace:SLaB.Navigation.ContentLoaders.Auth;assembly=SLaB.Navigation.ContentLoaders.Auth’. D:\Projects\Eventdrive\EDL.Silverlight.UI\RootPage.xaml 30 26 EDL.Silverlight.UI

  14. It has been solved:
    – the source code was found
    – Change Target Silverlight Version to: Silverlight 5
    – Rebuild all
    – Done!

  15. Hello David,
    Thank you for sharing, it has helped me so much. In CollectionPrinter.cs file you have a method “CalculateChild”. Within that the line number 12, var items = (ItemsSource ?? new T[0]).Cast().Skip(CurrentPrintContext.FirstItemIndex).ToArray();
    Gives me items = “{object[0]}” , instead of rows of data. How do I resolve it. I am new to Silverlight.


  16. Hi David,
    Does SLaB not work with Silverlight 5? I have a project that I am trying to fix, but having some difficulty. I notice that when the project is set to a silverllight 4 application it notices and recognizes the SLaB references. However in my circumstance I need the project to be a silverlight 5 application and when I try to add the references I get error messages stating that the tag ErrorPageLoader does not exist in the SLaB.Navigation.ContentLoaders.Error assembly, along with the tag ErrorRedirector, and The tag AuthContentLoader does not exist in the SLaB.Navigtation.ContentLoaders.Auth assembly.

    Have you encountered this before is there a work around?

    1. We were able to make it work for SL 5 but you will have to set up SLaB in the code behind; it will not configure correctly via XAML.

Leave a Reply

Software development and other goofy geeky goodness.