Mock up apps on the iPad

Review of Mock up / wireframe applications on the iPad

Exports X-code

Stencils/Sketching only

Bookmark and Share

Silverlight – Element is already the child of another element

Mike Talbot of Alterian has a clever way of taking most of the guesswork figuring out which piece of XAML is misbehaving, by progressively stripping out child nodes until the error is gone.
In his own words:
When the file has a problem it starts to prune out nodes in the XAML one XML node at a [...]

iPhone development on Windows

(Please email me if you want your SDK included, or post a comment)

Airplay SDK
DragonFire SDK – provides a BuildCenter
WinChain (free)

Other interesting ones

Appcelerator Titanium WebKit wrapper (requires Mac?)
PhoneGap
Unity 3D

var addthis_language = ‘en’;

Wrong user name password at imap.gmail.com

If you suspect an account has been locked out due to mistyped passwords, the account can be unlocked by going to a captcha page.
https://www.google.com/accounts/UnlockCaptcha
or Google Apps for Domain
https://www.google.com/a/[yourdomain]/accounts/UnlockCaptcha
e.g.
https://www.google.com/a/projectliftoff.com/UnlockCaptca

var addthis_language = ‘en’;

Binding to DatePicker in Caliburn.Micro

I’m running Silverlight, and I have a DatePicker control which I wish to bind automatically.
Recipe

Caliburn.Micro.ConventionManager.AddElementConvention(Of DatePicker)(DatePicker.SelectedDateProperty, "SelectedDate", "SelectedDateChanged")
Caliburn.Micro.ViewModelBinder.Bind(_reportFilterVm, Me.ReportFilter, Nothing)

var addthis_language = ‘en’;

Passing arrays to SQL statements safely

SQL Parameters only accepts scalar values. What if you wanted to pass an array as an IN criteria?
Here’s a workaround, without using stored procs. Just IFormatter magic.
You will be able to to this:

Dim ids(0 to 3) as integer
ids(0) = 32
ids(1) = 34
ids(2) = 42
ids(3) = 48
statement = SqlFormatter.Format("SELECT * FROM Persons WHERE PersonId in {0:f0}", [...]

Why Microsoft Lightswitch is not MS Access.

There is a great deal of concern among developers that Visual Studio Lightswitch will dumb down programming. Donald Belcham, for example, suggests that Lightswitch is going to be like MS Access with all it’s bad practices.
To the professional developers that read this blog (most of you I’m guessing), prepare to move your hatred and loathing [...]

FAIL: Microsoft wedges own app by sending bad data from the server

Microsoft managed to brick MSN Messenger rendering it not startable because the server sent corrupted configuration data to the client, which the client subsequently stores in the registry. I had to remotely dial in to my parent’s PC to fix this.
A fix for MSN Messenger crashing on start-up is here:

Start > Run > type “regedit” [...]

WCF Ria Services Composition

Download VS2010 project:
WcfComposition.zip
Sometimes, MSDN gives buggy information. If you are using Composition, there are a number of calisthenics required to make this thing work.

namespace WcfComposition.Web
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;
using [...]

Testing for overlapping/intersecting date ranges

How do we test whether one date range intersects/overlaps another date range?
There are six possible combinations to consider.

entire date range falls outside of our specified range (too early)
date partially falls partially inside our range (start date out of range)
date range encompasses our range entirely
date falls entirely inside our range
date partially falls inside our range (end [...]

SwivelPanel/Card Flip with Silverlight

John Papa has a nice Silverlight trigger to perform a “Card Flip”.
However, he didn’t show how it is possible to trigger the card flip on the reverse side.
Unfortunately, this can’t be done in Xaml. Fortunately, it only requires a few lines of code, and modification of the trigger.

[...]

element is already the child of another element domaincontext

The best way to troubleshoot this is by stripping of elements from your xaml on by one.
In my case, I had a ChildWindow which hosted a domain context. I don’t know why by this is sufficient to trigger the error.

<Grid.Resources>
<!– Commenting out the offending [...]

Silverlight Development – Required Background Reading

If you are an experienced developer, the guides on Silverlight.net are not as useful as the following: there are useful snippets that I come back for reference again-and-again, and they build the right conceptual idea of EF in your head.
Silverlight WCF Service Client

var addthis_language = ‘en’;

A pattern for Silverlight’s asynchronous operations

Silverlight can only invoke web operations asynchronously. Normally this would have led to a mess of logic. However, with anonymous methods, the problem can be managed. People who are familiar to Ruby blocks would see the similarity.
In the VB.net example below, I have a function AllocateSerialNumber which (eventually) returns a string.

Imports System.ServiceModel.DomainServices.Client

Dim myDomainContext As [...]

Silverlight 5 Wishlist

This article is reposted here
The MS Program manager need to watch some experienced developers new to SL try to develop a silverlight app. It’s painful. (I’ll put down how many hours I couldn’t bill due to these)

Use the browsers’ CultureInfo/locale info automatically. No code should have to be written. (0.5 hour)

LOB controls (DataGrid and DataForm) [...]

ASP.net 4.0 Silverlight Hosting Tweaks

Having strange 404 Not Found problems with your Silverlight deployment when it all works fine in your development environment?

This is what my hosting provider had to change to support WCF Silverlight deployments. Hope it helps you too.

Silverlight Navigation and Logon Forms

When a Silverlight page is shown, there are background threads that are still running. One of them is the user authentication service. This means that you don’t know whether the user is authorized to view the page or not, at least not until the operation has completed.

To be safe, you should not start any domain service (i.e. set AutoLoad=”False”) unless WebContext.Current.User.IsAuthenticated.

You also have to wire up a bunch of event handlers to monitor user’s status.

Styling combo boxes with new Silverlight 4 themes

Wonder why doesn’t your Cosmopolitan themed application pick up the styling for comboboxes, etc like the one in the demo?
In the App.xaml add the following section

<ResourceDictionary Source="Assets/Styles.xaml"/>
<– The following section is required for themes to work –>
<ResourceDictionary Source="Assets/Brushes.xaml"/>
<ResourceDictionary Source="Assets/CoreStyles.xaml"/>
<ResourceDictionary Source="Assets/SDKStyles.xaml"/>
<ResourceDictionary Source="Assets/ToolkitStyles.xaml"/>

var addthis_language = ‘en’;

Databinding ComboBox in Silverlight DataForms

Read the article below if you wish to bind text to a static list on comboboxes.
Read this article if you wish to fill the ComboBox with a list fetched from a database
Say we have a text field for “Gender”, which we want to set to either “Male” or “Female”, the basics of setting up the [...]

Troubleshooting Silverlight 4.0 and WCF Deployment problems

There’s plenty to read on the internet how to manually troubleshoot deployment issues.
However, none try to automate this. Here’s a little troubleshooting script. It worked for me (up to a point). Feel free to extend this if you encounter further issues.
(Update: also have a look at WCF issues that only my hoster could address)

<%@ [...]