iOS 7 Style Progress Meter in C#

On iOS 7, when you download or update an app from the App Store, there’s a small circular progress indicator that shows how complete the download is. It’s simple, compact, and provides information well. Making a version of this is incredibly easy using C# and Xamarin on your iOS app. Layers, Everywhere Every UIView has a property called Layer exposed that is responsible for what’s rendered inside that view. It’s of type CALayer and is a tree hierarchy, just like the view heirarchy.…

Upload to Azure Storage REST API from Xamarin

It surprised me to find that uploading an image to Azure Storage using the REST API with Xamarin iOS wasn’t straightforward. After a lot of research and by combining a couple techniques, we can easily upload a UIImage to blob storage using the Azure Storage REST API. Here’s what you’ll need: Azure Mobile Services (and client library) HttpClient I’m not going over how to create a storage location and container nor an Azure Mobile Service.…

ASP.NET Web API In-Memory Hosting Integration Test and Ninject

A while back, I posted how I used StructureMap along with the new ASP.NET self-host features to do integration tests on my ASP.NET Web API. Since that post, I’ve tried out Ninject with some new projects and, thanks to Filip, I discovered In Memory Web Hosting. This post will go over how to integration test an ASP.NET Web API project that uses Ninject for IoC and in memory hosting. I borrow from Filip’s post with adaptations for my purposes.…

Force Web API to Fail with ActionFilter

Sometimes, what you really want is failure. Success is great. Hooray! The crowds roar at your continued success. But in reality, everything is not peachy. Developers choose to ignore failure planning to their peril. Me? I need ASP.NET Web API to fail. In one of my projects, I utilize the ASP.NET Web API for the heavy lifting. My JavaScript and jQuery code make a lot of AJAX calls to the API and so far, I’ve got all of the success handlers written.…

Authentication and Membership Updates for MVC 4 RTM

I’ve spent the last couple days moving a project from MVC 4 RC to MVC 4 RTM. It’s gone well, but I encountered a couple trouble spots related to MVC 4 authentication and membership that I want to share. Starting Point I’m using a MVC 4 application that was created pre-RTM, so I’m working through some pain that won’t cause trouble for people creating new MVC 4 applications. Microsoft provides some information on how to upgrade a project from MVC 3 to MVC 4 on their website.…

Setup StructureMap with ASP.NET Web API Release Candidate

One important change from the Beta of Web API to RC was the way it handles IoC. So far, there have been a few guides of how to do it with Ninject or Unity, but I’m still using StructureMap for many of my projects. In a previous post, I showed how I used StructureMap in an integration test of Web API using NUnit. However, that was against the Beta and was in the context of automated testing.…

Amazon SimpleDb Basics in C# - Zero Padding

If you’re like me and are a developer used to working with relational, typed databases in C#, inevitably one issue will pop up as you write your code. You’ll be sitting there with a bunch of numeric data in your domain (table) and do a comparison or sort based on an integer. And the results will be f***ed up. If you’re a typical developer, you probably didn’t read all of the instructions on SimpleDb and that will be why your code failed.…