Sunday, January 26, 2014

Cross promote your apps on Windows Phone

Have you ever wanted to cross-promote your apps?  I used to maintain a list of my apps within those same apps!  What a pain that was.  Every time I released a new app I needed to update my other apps.  There must be a better way!

Two years ago I wrote an article for Coding 4 Fun called Let Your Apps Sell Themselves.  Today, I massively updated the code and create a Nuget package to simplify its use.  Check it out!

Among other things, it has a WP7 and WP8 version, it looks at the current version of the device it's actually running on to determine which apps to show, and it is localized for Spanish (more languages coming soon).

Link: Windows Phone App List Display 1.0.0

Wednesday, January 22, 2014

Need Windows Phone development help?

Looking for some help getting started with Windows Phone or trying to get an application ready to publish?  I'm using the relatively new Google Helpouts platform as a way to provide one-on-one instruction including webcam, chat, and screen sharing.  This service lets me charge for my time (a limited resource, to be sure!), but for a limited time Google is giving us providers promotional codes that we can use to introduce people to our services.  If you are interested in giving this a try and need a code, let me know!  I have 20 codes to give out so you'll probably get one if you need it.

My listings can be viewed here:

Modev Windows $10k App Contest Round 2

Update Central

Update Central for Windows Phone made it to Round 2 of the Modev Windows app contest!  I need your votes again to stay in the game!  If you haven't tried it yet, download it today.  With all the rumors and leaks in the news all the time, it makes it easy to stay on top of upcoming Windows Phone updates, read about past releases, and see what you have installed at the moment.  Get it for free today by clicking on the image, then, nter the contest by clicking on the contest link:

Nested entities won't return in RIA Services

Such stupid things we waste time on!  I had a RIA service which was supposed to return some entities and their entity-based properties.  My troubleshooting clearly showed the entities being present in the service but none of the included entity properties arrived at the client filled out.  Fiddler proved that these entities weren't being serialized.  So where were they?  The problem was that it was an Invoke operation.  I guess I didn't fully understand the difference between Invoke and Load operations.  Very important!

An Invoke operation is intended to return scalar or single-Entity values.  In fact, it can even return a collection of Entities, but it specifically won't return nested properties.  It makes sense when you realize that by definition, Invoke operations don't return tracked entities.  Returning a fully populated object graph without the tracking is seldom something you really want.  Unfortunately, I had to switch into calling two service methods: one to do some entity creation, then a second call to retrieve the created objects as a complete graph.  Clearly not super difficult, but until you realize the limitation you just bang your head against the wall!

Tuesday, January 21, 2014

The parameterized query ... expects the parameter ..., which was not supplied

After spending too much time on a null parameter issue, I finally found the solution!  If you try to execute a parameterized query against an object context in Entity Framework it's not enough to create a parameter and set it null.  You'll get the dreaded "was not supplied" error.  Instead, you have to explicitly set the value to DbNull.Value.

Bad Example:
string x = null;
var p1 = new SqlParameter("param1", x);

Good Example:
string x = null;
var p1 = new SqlParameter("param1", x);
if( x == null ) p1.Value = DbNull.Value;

The more you know!


Twenty-four hours of coding may sound like a lot, but most devs have stayed up pretty late coding before.  CodeDay is a great opportunity for students (HS and college) to participate in a coding event to create apps or games for fun and judging.  Ideas and teams form at the beginning, and then loud music plays as everyone works on their projects through the night.  For games this usually includes music, sound effects, 3d models, sprites, levels, story, and of course the code behind it all.  We had around 30 students in Corvallis with lots of great ideas and fun for everyone!  HP let us use their facilities which was an amazing setup for such an event, and they gave everyone a great tour of their fab areas and massive printing equipment.

If you've never had a chance to take part in one of these, you're really missing out!  We hope to do it again in the future and hope for it to grow even more.

Link: Corvallis Codeday

Thursday, January 16, 2014

Vote for me!

I've got three apps entered in the MoDev Windows $10k App Contest.  There are a huge number of apps on there, but mine are Update Central (keep up to date on Windows Phone updates and releases), Grade Viewer (a Pinnacle PIV grade app), and Dash Recorder (a dash cam app for recording incidents on the road).  If you like any of these apps, please consider putting in a vote for them.  Thanks so much!

Link: Contest entry

Tuesday, January 14, 2014

Silverlight Image Converter

I wrote a simple converter to go from an enumerated type to a different image per value.  Sounds simple, right?  It checks the value, then returns a new BitmapImage with the appropriate image path:

if( v == Enum.Thing ) path = "/images/thing.png";
return new BitmapImage(new Uri(path, UriKind.Relative));

Unfortunately no image appeared.  So frustrating!  It turned out that even though I was starting with a leading slash, it was loading from the wrong root.  No errors, just no image.  A quick run-through with Fiddler showed me what was going on.  After examining the code, I was sure everything was right.  Fiddler is the best tool for finding those weird things that come from needing that closer look!

Monday, January 6, 2014

Looking to get started with programming?

Scott Hanselman (a Microsoft software developer) just published a great post about getting started with programming.  I highly recommended it if you want to get started but don't know what to do.  People ask me this question fairly often, and my new response will be to direct them here!

Link: Scott's Blog