I just finished setting up my Windows Phone 8 development environment on a fresh operating system.  Everything went smoothly…and then I attempted to debug  a Windows Phone 8 app using the emulator.  That’s when things started to get difficult, and I mean really difficult!

To be fair, I have several things working against me on this setup.  For almost two years, I have been happily running dual operating systems on a late-2011 MacBook Pro, and recently I installed a new hard drive and a fresh installation of Windows 8 Pro on a BootCamp partition.  In addition, I typically have no ...

Learning a new programming language is a lot of fun, but it can be disorienting to not have all of your usual tools in your mental toolbox, so to speak.  We get used to using our familiar patterns and syntax, and even though the new language may be just as capable, it takes some getting used to in order to have the same level of productivity.  It’s been over a year since I started working on iOS apps in Objective C, and still I sometimes find myself searching for ways to write a block of code that I could write ...

If you happen to be experienced in development using Visual Studio, but a bit new to working in XCode for iOS development (like me), you are probably used to your application breaking on exceptions during debugging.  But by default, your iOS application may not act as you expect when it comes to debugging crash exceptions.  You may instead see something like this:


testbreak.xcodeproj — main.m

With an error message that says: 

*** Terminating app due to uncaught exception


What?  Why was my exception uncaught while I am debugging?  I, for one, would rather be taken to the point at which the exception ...

Last week I found myself debugging an issue with Apple Push Notifications service (APNs) on one of our development servers, and learning a bit about APNs certificates and Windows Server 2008 R2 with IIS 7.5 in the process.

 

My first task was to try to isolate why the push notifications weren't received by our iOS devices, so I started on my local development machine.  I installed the certificates into my personal certificate store, stepped through the notification code, and sure enough I heard my iPad chirping telling me the notifications were being received.  It turned out that the certificates ...

Apple does a lot of neat things with images in iOS, and many times we get the benefits of shiny, chrome-like effects on our images without really doing anything.

If you create a new tabbed application in XCode, the default setup will give you two tabs, with square and round images in the tab bar for the tabs.

Note the shiny blue appearance of the selected tab.  So, what do the original images look like?  Pretty boring, actually:  just a plain black circle and square.

Wow, that's a quite a difference.  Pretty cool, right?  I thought so too.  But then ...

Here's a tip for the iOS beginners among us:  Just because something is on the left doesn't mean it's called Left.  LeftBarButtonItem, for example, might just take you down the wrong path if you’re not careful.

Let's say you are wanting to show customized text on the button that shows up on the left side of the navigation bar in an iOS app.  In an unmodified Master-Details iPhone app, it is the button that returns you to the Master table view screen from within the Details view.

By default, that button displays the Title text from the previous ViewController.  The ...

 

I have been using Telerik’s RadDataForm in some Silverlight applications for some time, and have been very happy with the results.  But I only recently discovered another reason to like it – the ability to do some non-collection bindings that are not available in the standard Silverlight toolkit DataForm.

If you have used either DataForm, you are probably aware that from inside of your item templates, the DataContext is always relative to the currently displayed item.  So, if I am displaying a collection of ‘TestData’ items:

public class  TestData
{
     public string  Name {  get;  set; }
     ...

While working on an MVVM project, I was recently debugging an issue with some of my Silverlight ComboBoxes.  The ComboBoxes were bound to pre-set values in the ViewModel, and yet were showing up empty when rendered on the page.  What was really troubling was that some ComboBoxes were working correctly, but others were showing up blank, when they were bound to the same ViewModel and everything looked to be exactly the same!

Here’s a sample project where I’ve reproduced the problem:

Both ComboBoxes are bound to the same ItemsSource, and both have simple int values as their bound SelectedValue ...

Many Windows Phone 7 developers (including those at Falafel) are pretty excited about the new features available in the upcoming ‘Windows Phone Mango’ update.  One of the features we are hearing a lot about is the new ‘deep linking’ through push notifications and also in live tiles.  It’s easy to find article after article listing this as one of the exciting upgrades to the WP7.

What’s not so easy to find is a simple example of these deep links!  Even the examples from MSDN which were supposed to be previewing the new release seemed to leave out this important part.  ...

I have written several times about using CollectionViewSource in Silverlight.  It is often highly useful to be able to use a CollectionViewSource and the related CollectionView objects as the ItemsSource for advanced editors like the Silverlight DataForm, DataGrid, or Telerik’s RadGridView controls.

But sometimes binding to all of those different editors can get a CollectionView into an open editing or insert state that can be difficult (maybe even impossible) to track down, especially when you need to asynchronously alter properties on the parent CollectionViewSource like filters or grouping.  Enter the dreaded exception: “…not allowed during an AddNew or EditItem transaction”.  ...

I was recently working with a CollectionViewSource in a Silverlight project, but needed to display groupings of the data items as ‘Rankings’, that is: sorted by the number of items in each group.  There are a variety of resources out there on how to sort the items in a CollectionViewSource, and even how to sort the items within a group (this one, for example), but less information on how to sort by how many items are in each group.

Let’s take a look at an example CollectionViewSource:  in this case based on a List of DateTime objects representing ...

CollectionViewSource is quickly becoming one of my go-to tools for complex data viewing and editing in Silverlight.  The Grouping, Filtering, and Sorting operations make what were once difficult features simple and straightforward.  But I sometimes expect too much from CollectionViewSource’s performance with large data sets, and then things get more interesting.

I was working with large sets of complex data in a DataGrid, using the CollectionViewSource’s Filter operations to allow the user to ‘Delete’ rows while still keeping the items in the underlying collection to allow either a ‘Cancel’ or a ‘Save’ operation to finalize the change.  Since CollectionViewSource’s Filtering ...

 

I recently found myself using #ifdef preprocessor directives to turn on and off the same pieces of diagnostic code in multiple files all across a project.  We have all used Debug methods, which are turned on and off universally by defining (or not defining) the DEBUG constant.  Isn’t that convenient?  All the lines of code that we want removed at compile-time when not debugging are controlled just by one constant – for an entire project at once!

 

We can do the same thing using conditional methods.

 

Define a conditional method using the Conditional attribute before the method ...

 

If you aren’t familiar with it, the ValidationSummary control in Silverlight automatically shows validation exceptions for any controls within its same container element.  That means if you add it to a grid or StackPanel that is full of bound controls, it will capture any validation exceptions from those bindings.  It also gives you all kinds of useful functionality, like taking you to the invalid control when clicking on an item, and even removing the message when the input is corrected.

For example, these two textboxes are bound to FirstName and MiddleInitial properties, and MiddleInitial is required to be a ...

 

This tip, which is not quite obvious from all the RadGridView documentation, works for more than just refreshing aggregates – it can be useful any time you are doing some non-standard manipulations behind the scenes and for whatever reason, the RadGridView isn’t updating to show your changes.

 

In my case, an AcceptChanges() call to a DataRow in a DataTable was getting new server data to show up, but not notifying the grid that it needed to recalculate aggregates. 

 

Although the aggregate would be correct on a full data load,

 

after a partial update, getting new data ...

 

Have you ever wanted to use one of your custom attached properties in a control template?  Well I have, but I never could quite get the syntax right, and my bindings always failed.  I had started to think it wasn’t possible!  It was almost as if the template could never quite find the namespace of the attached property once it was applied to the control.

But then I saw a piece of Silverlight 3 code  that included another declaration of the namespace inside the element tag, and I thought Oh!  Maybe that will help with those times when the ...

This answer is easy to find once you realize it was the addition of a CaretBrush in a TextBox that started the blinking…but if you’ve just added in a bunch of Styles and Resources with dozens of additional properties, well, it could take a while.  Hopefully this post will help someone find the answer a little quicker.

Applying any StaticResource brush to the CaretBrush property of a regular TextBox in Silverlight 3 will apparently cause everything else using that StaticResource to blink with the caret blink.  Odd, very odd indeed!  The fix is easy, of course…just don’t re-use your caret ...

Telerik’s ComboboxColumn for the Silverlight RadGrid is highly useful for presenting drop-down list options for the user in a grid-editing scenario.  But it’s also very easy to template, and you can even template the ‘Display’ look of the cells to match that of your dropdown list items.  Using templates, we have the ability to display the dropdown choices using data-driven visual elements, for a much richer user experience.

Here’s an example of using a simple template that utilizes a custom Background and Foreground color, based upon properties of the underlying data.  First, a look at the sample data used for ...

If you aren’t aware of the unique qualities of Falafel Software, here’s one for the archives.  Falafelites are located across 4 time zones in California, Colorado, Texas, and Michigan, and through each other we get to experience lives beyond our own.  Someone is always sharing a cool story about what’s going on in their little world, and it is interesting to see how we can all morph from day-time (and sometimes night-time) developers or trainers into weekend warriors of such different types.

Among other things, we get to enjoy awe-inspiring photography, hear the surf, mountain biking, or maybe snowboarding reports, ...

I have been using Telerik’s RadTabControl for Silverlight for a while, and have finally been able to upgrade to the new Q3 2009 release. Happily, I am noticing some new features from my wish-list which will make tab navigation oh so much easier.

I have been looking forward to the new scrolling and dropdown overflow features since the Beta version, these are absolute necessities when using many tabs. When the user selects an item in the drop down, it is automatically scrolled into view with a nice smooth scrolling action. The scrolling works with the dropdown even if you do ...