Daniel Vaughan

.NET Adventures

Writing Windows Phone 7 Unleashed

clock July 28, 2010 13:21 by author Daniel Vaughan

For the last couple of months I've had my head down writing a WP7 book. Entitled Windows Phone 7 Unleashed, it will be published though Sams Publishing. I'm pouring lots of tips and techniques into this book, along with the requisite WP7 development info. The book will lead you through end to end production of WP7 apps, from developing Silverlight and XNA apps, through to certification and publishing on the Windows Phone Marketplace.

Figure 1: Windows Phone 7 Unleashed cover (may change)

There are also many sample applications for just about all the main topics. One such sample, in the chapter on Push Notification, demonstrates toast, tile, and raw push notifications using a stock ticker app. It allows you to register to receive stock price updates, for a particular stock symbol, via a cloud service. The cloud service periodically sends real stock prices to the device, as you can see in the following screen shots.

 

Figure 2: Raw notifications are received in the Stock Quoter screen. Figure 3: Toast and tile notification are received showing updated stock market quotes.

 

It's just one of many apps in the book.

I'm very excited about WP7. I really like the simplicity of the geo location API, and how social networking is integrated into the OS. There are many reasons why WP7 will transform mobile development. I still have a long road ahead of me with the writing of the book. I'll be posting more about phone development in the coming months.

 



Introducing the Model Thread View Thread Pattern

clock May 1, 2010 13:09 by author Daniel Vaughan

Reduce threading code, and increase UI responsiveness with a new pattern extending MVVM. The article describes an approach that leverages the facilities that make MVVM so effective. The MTVT pattern is an architectural pattern used for explicit demarcation of the view and view model via disparate threads of execution.

Read more




Scored a Triple!

clock April 26, 2010 17:01 by author Daniel Vaughan

Seems I've done rather well this month in the CodeProject article competions. With two articles I managed to take out three awards. I'm chuffed!

So, ok, now I get to gloat a bit. ;)

I won the Best C# and Best Overall article categories with this article.

And I won the Best VB.NET article category with this article.

Kudos goes out to my usual nemesis and, at the same time, good friend Sacha Barber. Sacha's awesome Bread Crumb control could have won it. Likewise Colin's innovative Linq to Tree article was tops. See Sacha's TimeLineControl for a simply superb piece of work. I forsee it being a definite winner for April's comp.

Thanks also go out to all those who supported me!



IEnumerable IsNullOrEmpty

clock April 18, 2010 15:39 by author Daniel Vaughan

String.IsNullOrEmpty is a commonly used method for determining whether a string is null or has a zero length. But, no such method exists in the FCL for collections. A moment ago I whipped up an extension method for IEnumerable types. It's not rocket science, but I thought I would post it anyway.

public static class Extensions
{
    /// <summary>
    /// Determines whether the collection is null or contains no elements.
    /// </summary>
    /// <typeparam name="T">The IEnumerable type.</typeparam>
    /// <param name="enumerable">The enumerable, which may be null or empty.</param>
    /// <returns>
    ///     <c>true</c> if the IEnumerable is null or empty; otherwise, <c>false</c>.
    /// </returns>
    public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
    {
        if (enumerable == null)
        {
            return true;
        }
        /* If this is a list, use the Count property. 
         * The Count property is O(1) while IEnumerable.Count() is O(N). */
        var collection = enumerable as ICollection<T>;
        if (collection != null)
        {
            return collection.Count < 1;
        }
        return enumerable.Any();
    }

    /// <summary>
    /// Determines whether the collection is null or contains no elements.
    /// </summary>
    /// <typeparam name="T">The IEnumerable type.</typeparam>
    /// <param name="collection">The collection, which may be null or empty.</param>
    /// <returns>
    ///     <c>true</c> if the IEnumerable is null or empty; otherwise, <c>false</c>.
    /// </returns>
    public static bool IsNullOrEmpty<T>(this ICollection<T> collection)
    {
        if (collection == null)
        {
            return true;
        }
        return collection.Count < 1;
    }
}

 

IEnumerable.Count is O(N), while List.Count is O(1), hence the test for the IList type.



Microsoft MVP Award

clock April 3, 2010 18:24 by author Daniel Vaughan

I arrived back in Geneva on Thursday night, after spending a couple of days in Belgium attending Techdays 10. I had a blast, and some of the highlights for me were:

  • The presentation by my good friend Laurent Bugnion entitled A day in the life of a WPF/SL. Very cool.
  • I had the opportunity to ask Anders Hejlsberg about the new .NET 4.0 default parameter feature.
  • I attended a presentation on Moles. Looking forward to using that. One can replace any .NET property or method with a delegate!
  • Scott Hanselman’s keynote on day two was just so entertaining. Loved it.

All in all, it was a terrific event.

To top it all off, I discovered my MVP award from Microsoft waiting for me when I arrived home! MVP profile



Article Published: Building a Windows Phone 7 Puzzle Game

clock March 25, 2010 12:42 by author Daniel Vaughan

Get a head start with the new Windows Phone 7 developer tools. Learn how to create a Sokoban game in Silverlight for the WP7 platform.

View Article



Synchronous Web Service Calls in Silverlight using JavaScript

clock March 18, 2010 15:50 by author Daniel Vaughan

MVP Valentin Billotte has written a very interesting article about using JavaScript to call web services in Silverlight with the ability to block until call completion on the UI thread.



Article Published: Context Sensitive History. Part 2 of 2

clock March 13, 2010 18:33 by author Daniel Vaughan

This part focusses on the Calcium integration of the Task Model.

This project is a Desktop and Silverlight user action management system, with undo, redo, and repeat. Allowing actions to be monitored, and grouped according to a context (such as a UI control), executed sequentially or in parallel, and even to be rolled back on failure.

A 'task' is the term I use to describe application work units,
instigated by the user or the system.

The main features of the task management system provided in this article are:

  • Tasks can be undone, redone, and repeated.
  • Task execution may be cancelled.
  • Composite tasks allow sequential and parallel execution of tasks with automatic rollback on failure of an individual task.
  • Tasks can be associated with a context, such as a UserControl, so that the undo, redo, and repeat actions can be, for example, enabled according to UI focus.
  • Tasks can be global, having no context association.
  • The task system can be wired to ICommands.
  • Tasks can be chained, in that one task can use the Task Service to perform another.
  • Return to a point in history by specifying an undo point.
  • Coherency in the system is preserved by disallowing the execution of tasks outside of the Task Service.
  • Task Model compatible with both the Silverlight and Desktop CLRs

View Article



Calcium now on Twitter

clock March 5, 2010 23:56 by author Daniel Vaughan

Calcium SDK development news can now be found in 140 characters or less.

 



Article Published: Context Sensitive History. Part 1 of 2

clock February 24, 2010 22:13 by author Daniel Vaughan

A Desktop and Silverlight user action management system, with undo, redo, and repeat. Allowing actions to be monitored, and grouped according to a context (such as a UI control), executed sequentially or in parallel, and even to be rolled back on failure.

A 'task' is the term I use to describe application work units,
instigated by the user or the system.

The main features of the task management system provided in this article are:

  • Tasks can be undone, redone, and repeated.
  • Task execution may be cancelled.
  • Composite tasks allow sequential and parallel execution of tasks with automatic rollback on failure of an individual task.
  • Tasks can be associated with a context, such as a UserControl, so that the undo, redo, and repeat actions can be, for example, enabled according to UI focus.
  • Tasks can be global, having no context association.
  • The task system can be wired to ICommands.
  • Tasks can be chained, in that one task can use the Task Service to perform another.
  • Return to a point in history by specifying an undo point.
  • Coherency in the system is preserved by disallowing the execution of tasks outside of the Task Service.
  • Task Model compatible with both the Silverlight and Desktop CLRs

View Article



About the author

Daniel VaughanDaniel Vaughan is a software developer with a decade of commercial experience across a wide range of industries including e-commerce, multimedia, and finance. While originally from Australia and the UK, Daniel is currently based in Geneva Switzerland; working with WPF, WCF, and WF within the finance industry. In his spare time Daniel likes to spend time concocting novel ideas, such as employing neural networks to predict user navigation behaviour in WPF applications, and a grid computing framework for Silverlight. Daniel is also the creator of a number of open-source projects including Calcium, and Clog. E-mail me Send mail

 

Microsoft MVP logo Disciple
CodeProject MVP
WPF and Silverlight Insiders

 

 

RecentComments

Comment RSS

Sign in