Monday 25 March 2013

Thursday 14 March 2013

Sample class: Clone a generic list of strings with xamlwriter and xamlreader

This is how to do it. Use it like this:

ListOfStrings.HelloWorld();

"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WpfApplication1
{
        public class ListOfStrings : List<string>
        {
                public static void HelloWorld()
                {
                        // Create listOfStrings object
                        ListOfStrings listOfStrings = new ListOfStrings();
                        listOfStrings.Add("Hello world");
                        listOfStrings.Add("Hello world once more");
                       
                        // Serialize it with xaml writer
                        var xamlSerializedListOfStrings = System.Windows.Markup.XamlWriter.Save(listOfStrings);
 
                        // Deserialize serialized string with xaml reader
                        object deserializedListOfStringsObject = System.Windows.Markup.XamlReader.Parse(xamlSerializedListOfStrings);
                       
                        // Test for correct deserialized type
                        if (deserializedListOfStringsObject is ListOfStrings)
                        {
                               // OK, cast it from object to ListOfStrings
                               ListOfStrings listOfStringsClone = (ListOfStrings)deserializedListOfStringsObject;
                        }
                }
        }
}
"

Tuesday 12 March 2013

Small jQuery demo

Follow below link to see a simple jQuery page in action.

Code to the left, and web page to the right.

Gives you an idea what jQuery development is.

LINK: http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_hide


Video Tutorial: The Official Guide to HTML5 Boilerplate

If you consider cross platform HTML5 development the HTML 5 boilerplate might be a good recommendation for you:

http://net.tutsplus.com/tutorials/html-css-techniques/the-official-guide-to-html5-boilerplate/

It lasts for 40 minutes and contains nice tips for beginners.