• MeXperience – Step 3 – Architecture, implementing pipes and filters

    In step 2 I explained about the Architecture of MeXperience I had in mind. This article explains the implementation of the pipes and filters pattern to filter the list of experience objects. I will start to tell that my implementation is based on an article from Oren Eini. The Filter In MeXperience there are currently only two types of filters: by tag and by role. But I could think about others like a filter by year of experience. The idea of the filter in the pipes and filters patterns is to have a simple operation, and a lot of combine simple operation in one pipeline make a complex operation. My filters are also used as objects to represent an item in the TagCloud. This is my base.
    public abstract class CloudItem
    {
        public CloudItem()
        {
            Weight = 1;
        }
    
        public int Weight { get; set; }
        public string Name { get; set; }
    
        public abstract IEnumerable<Experience> Filter(IEnumerable<Experience> experiences);
    }
    
    Yes I know it’s abstract and there’s no filter implementation. First the signature, there’s an enumeration of experiences coming as input, and there’s an enumeration as output. Let’s see one of the implementations, the of CloudItemTag.
    public class CloudItemTag : CloudItem
    {
        public ...

    Full story

    Comments (2)

  • Capture usage information of a Silverlight application using Google Analytics and a Blend Behavior

    It’s already more than a year ago since Tim Heuer published his article on Event tracking in Silverlight. Since that time we’ve got Silverlight 3 and Silverlight 4 beta. So it’s time for a different implementation that can even be used by non-coders. This article will make use of Silverlight 4 beta, but in the end almost everything works on Silverlight 3 as well. The idea Create an Expression Blend Behavior that does all the tracking for me! The implementation – Some Javascript Blend Behaviors are extremely easy to use. Designers can use them without having knowledge on code and besides that they don’t dirty the business flow of the code. Also Behaviors can be used very easily in combination with DataTemplates and BindingExpressions. Let’s start with the very beginning. On the html-page there needs to be some Javascript from Google Analytics to start the Analytics script.
    <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
      try{
        var pageTracker = _gat._getTracker("UA-xxxxxx-x");
        pageTracker._trackPageview();
      } catch(err) {}
    </script>
    This is the generic Google Analytics script to start the normal tracking. Please make sure that you replace xxxxxx with your own Tracking Code ...

    Full story

    Comments (0)

  • MeXperience – Step 2 – Architecture and more

    Besides the purpose of the application itself, I want to make sure I expand my knowledge on Silverlight. This would be especially on the architecture of Silverlight applications. Architecture - MVVM I’ve read quite a lot of articles on MVVM, but there weren’t many article series that were as complete as the series on RIA, MEF and MVVM by Shawn Wildermuth (1,2,3,4). I have no intend to write an article or series on MVVM because it’s not really in my fingers yet. But to know more on MVVM please read the fantastic series by Shawn. But then again my intend is to make use of MVVM for MeXperience. The idea is to introduce two ViewModels (please let me know if you’d advice a different setup for ViewModels). 1. The ExperienceFilterViewModel, which supports showing all experience-tags and the ability to form a filter. 2. The ExperienceViewModel, which has control over all experience-parts that are found in the data store and can interact independent from the filter but can have filters applied as well. Because I chose to use the articles by Shawn as my knowledge base for MVVM, I will make use of ...

    Full story

    Comments (0)

  • MeXperience – Step 1 – Idea + Prototype

    Every now and then I have some ideas. That’s also the main reason why I created a Windows Mobile application to support at least the storage of my ideas to be sure that those ideas don’t get lost. Some ideas will never be more than just an idea. One of my latest ideas was the below idea. I want to implement this idea, in the time I have (very little). MYdea: MeXperience I want application that can show my work experience in an interactive way. I was thinking tag-cloud, tiles, details, photo. Yes a tag-cloud with the different technologies and roles that have been covered in the experience. If you would click on any item in the tag-cloud, it would be part of the filter. The filter would be applied to the experience. I wanted to show blocks of experience, to offer a different experience than what people are used to in common curricula vitae. And when you click on a block, the details of the block would be shown. Maybe more features would be appear in the future, but this is it for now. Prototype So what I did was, start with Sketch Flow. Sketch Flow is my favorite ...

    Full story

    Comments (0)

  • Silverlight 4 – Credentials, we’ve got it!

    I’ve been writing on Credentials in context of Silverlight for some time now. I didn’t like the options that were available to secure services and allow integration with Silverlight. For some history search for “credentials” on my blog. July 2008 – Silverlight 2 – A series of articles on possible (failed) work-arounds for getting Credentials in Silverlight. March 2009 – Silverlight 3 – WebClient, WebRequest and WCF calls using Credentials? July 2009 – Silverlight 3 – Did we get support for Credentials?   In Silverlight 3 we already got the property Credentials on both WebClient and WebRequest. But sadly there still was no implementation available. After the launch of Silverlight 3 Tim Heuer already commented that the feature for credentials was being considered for future versions. Very nice, specially because we finally got it in Silverlight 4 (beta). Support for Credentials has come to the ClientHttp stack, so you must make sure you register the http prefix to be using ClientHttp stack.
    WebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.ClientHttp);
    Besides that we also need to make sure that we set the property UseDefaultCredentials to false. Depending on whether you make use of a WebRequest or use a WebClient it will look like this.
    request.UseDefaultCredentials = ...

    Full story

    Comments (2)

  • Silverlight 3 – Local Messaging Explained + Enhancement

    One of the new features Silverlight 3 introduced is called Local Messaging. This feature supports communication between different Silverlight applications that are running on the same client. This is particular useful in areas like Sharepoint where you offer different parts to be positioned at all places on the screen. It’s possible to even communicate between two Slverlight applications running on different domains. For example one app is running on maindomain.com and the second app is running on maindomain.nl or even more different. The Local Message API is very easy to use. But let’s first setup the Proof of Concept environment. I created a solution with two Silverlight Applications (SUILeft and SUIRight), a hosting project (Web) and a fourth project which is a Silverlight Class Library, we will come to that soon. I combined both the “Left” and “Right” applications in one html page, like this (please remind to change the paths according to your setup).
    <div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="40%" height="100%">
            <param name="source" value="ClientBin/MM.Silverlight.SUILeft.xap" />
            <param name="onError" value="onSilverlightError" />
            <param name="background" value="white" />
            <param name="minRuntimeVersion" value="3.0.40624.0" />
            <param name="autoUpgrade" value="true" />
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
                <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"
                    style="border-style: none" />
            </a>
        </object>
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="40%" ...

    Full story

    Comments (0)

  • OpenID User Control in Silverlight – Part 2 OpenID Integration

    It’s already a long time ago when I posted part 1 of the OpenID User Control, but sadly I didn’t have any time to blog, until now. Recap: Part 1 explained how to create the visual design of the user control with two visual states. The visual design we create was also templatable, so you can provide your own template if you wish without changing any inner code. Let’s continue with this part. OpenID Integration The integration with OpenID is basically url-based. The application providing the login view constructs a url, redirects to this url, and after successful authentication it will redirect back to the application with a lot of parameters in the url. First of all the integration starts with the identity, also url based. For example the identity http://openid.mymonster.nl/demo has even an page attached. The source in the page contains the links to the OpenID server. In this case:
    <link rel="openid.server" href="http://www.myopenid.com/server" /> 
    <link rel="openid2.provider" href="http://www.myopenid.com/server" />  
    This information is used while construction the login-url. The base url in this case would be: http://www.myopenid.com/server?openid.ns=http://specs.openid.net/auth/2.0&openid.mode=checkid_setup In addition to this base url the following parameters are added as well. openid.identity=http://openid.mymonster.nl/demo openid.claimed_id=http://openid.mymonster.nl/demo openid.return_to=http://somedemo.mymonster.nl OpenID also has some ...

    Full story

    Comments (277)

  • OpenID User Control in Silverlight – Part 1 UI Design

    More and more I see sites supporting OpenID as Authentication mechanism. I’m for example a user of sites like: I need to read this, Get Satisfaction and Google Login more or less. To support my own family I set up OpenID on my own domain, http://openid.mymonster.nl/ hosted by MyOpenID. This just works like a charm. For the purpose of this article I created a test identity at my MyOpenID. I suggest everyone doing development for openid connectivity to create a test identity, I don’t want to mess with my real OpenID identity. This is part one of a three part series on the creation of an OpenID User Control. I initially created the control for use in my own application and have submitted it to the Silverlight Control Builder Contest of 2009. UI Design One of the first things I was thinking about, was my design capacities. I came up with the following design, before signing in. After you have signed in. Yes I know, it’s very straightforward, and all the designers in this world could have thought about a better alternative. That’s why I thought this control to require the ability to template it. There are ...

    Full story

    Comments (0)

  • Tracking Silverlight (1, 2 and 3) support in Google Analytics

    Half a year ago I blogged about tracking Silverlight support in Google Analytics. I’ve had a lot of reactions on how to track Silverlight support. In my original article I made use of virtual page views to track Silverlight support. But there are different options available to track Silverlight support. Tracking through Virtual Page Views When you make use of Virtual Page Views to track Silverlight support you will get inconsistencies in your Page Views. You will get twice as much Page Views as there really are, not the best solution I think. Tracking through Events We can also track information in Google Analytics using Events. But it’s difficult to associate this information directly to the amount of visitors. I think using Events for tracking Silverlight support is the second best option we have. Tracking through User Defined Value We can also track information using the User Defined Value. This value is directly associated to the visitor. So even if your visitor takes a look at 10 pages, it will only track this value once. But the difficult thing with Google Analytics is the amount of User Defined Values we can have. It’s exactly one. So if you’re ...

    Full story

    Comments (0)

  • Silverlight 3 – Did we get support for Credentials?

    A few months ago, I investigated Silverlight 3 Beta on support for Credentials. There are two classes that give a little bit of notion that they are supporting Credentials. Both WebClient and WebRequest have a property Credentials of type ICredentials. Let’s try them one by one. WebRequest credentials support? First we need to have some code to request the content behind an url and assign a set of credentials to the request.
    WebRequest request = HttpWebRequest.Create("http://mark.mymonster.nl");
    request.Credentials = new NetworkCredential("username", "password");
    Very straightforward code which you can write for the full CLR as well. This code doesn’t even contain the execution of the request. Yes it fails. If you try to set the de Credentials you will get a NotImplementedException. Sad, so we have not support for credentials in the WebRequest. WebRequest credentials support outcome: Negative WebClient credentials support? Next class with a Credentials property, WebClient. First let’s write some code.
    var client = new WebClient
                     {
                         Credentials =
                             new NetworkCredential("username", "password")
                     };
    client.DownloadStringCompleted += client_DownloadStringCompleted;
    client.DownloadStringAsync(new Uri("http://mark.mymonster.nl"));
    
    Of course if anything goes wrong we can see it in the DownloadStringCompleted. From QuickWatch, we can see what happened. Hmm, I could have guessed that WebClient internally makes use of WebRequest. ...

    Full story

    Comments (0)