Developing in XAML (Windows 8, Silverlight, Windows Phone, or WPF) gives you a powerful combination of declarative markup with databinding, but one shortcoming I often come up against is the ability to build simple ComboBox elements declaratively with both Content and Values.
If you are familiar with HTML, you know that you can use a select tag to pair the display name with a key value, such as:

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value...

In some of my previous WP7 blogs, such as Basic XNA Graphics for the WP7, I go over how to build basic 3D models for your applications. What happens when you want something more complex? You need a good 3D tool to generate those models for you. I started exploring Google SketchUp as a possibility for generating 3D models for the WP7. I found Jim’s Blog on how to load a Google SketchUp model into a XNA game. Jim used the DirectX/XNA Exporter Plugin. So I installed the plugin and started playing around. I thought it would ...

I have seen an interesting and sometimes annoying side effect of using Silverlight binding on string properties that makes them turn from a null string to an empty (length 0) string. Typically my bindings are bound to WCF RIA Services entities that can have a nullable string. By simply selecting and then unselecting a TextBox that is bound to a nullable string in an entity will cause it to become an empty string.

 

This wasn’t what I wanted to happen. I need strings that have been changed to empty to stay null if and only if the underlying entity ...

The Problem

I recently discovered that the default Silverlight DateTime format is different on MacOS than it is in Windows.

 

On Windows

windows

 

On MacOS

mac

 

There are a couple of differences, but the most noticeable is that time zone offset at the end of the time that shows on the Mac. On my computer the time zone offset shows as “-4:00” because I’m generating a DateTime in local time, which for me is currently Eastern Daylight Time (EDT), or 4 hours behind Coordinated Universal Time (UTC).

 

The application is following the best practice of storing all DateTimes ...

There are some instances where the the obstructive Silverlight Toolkit BusyIndicator might not be the right choice for your application. BusyIndicator pops up a control on top of all other controls that shows a message and a graphical animation. I wanted to create a more passive control that doesn’t pop up a control but it still disables all the controls on the page and shows a message on the page.

First I started by creating a User Control. Within this control I added a TextBlock and an Image that I’ll use to set some busy text and an animated image. ...

MVVM (Model-View-View Model) is a programming pattern similar to MVC that you can use to decouple the model and the view from business logic. There are many articles on the internet about what MVVM is so I’m not going to talk about that. In this article I want to concentrate on the most basic MVVM application, understanding it, and how to move on from there.

This example doesn’t have a Model. More than likely when building even the simplest application you will need access to data. If you create an Entity Framework (ADO.NET Entity Data) Model, this would indeed be ...

I’m a huge fan of the Microsoft Prism framework. In fact, I’ve blogged before about using its DelegateCommand to minimize your ViewModel code.

Lately, though, I noticed that once its CanExecute delegate returns false, your IsEnabled binding will not update, even when the property it’s bound to changes.


Try It Out: Live Example

Note: Silverlight 4+ Plug-in Required
Get Microsoft Silverlight

 

As you can see, the button entitled “Prism Command” starts out disabled and never enables, even though its IsEnabled property is bound to the same property of the ViewModel as the other buttons (see below).

 

<Button Content=...

Silverlight provides a robust development environment and a rich user experience, but one shortcoming becomes evident when users ask "why can't I highlight and copy text in the application?"  Unlike standard web pages, when you use the Silverlight TextBlock, the text is inaccessible to the user and behaves almost like it is a background image.

There are several ways to remedy this, including building a custom control, but the simplest solution I've found is to use a TextBox control (which allows users to select and copy text) and style it to look like a TextBlock.  To do this, create a ...

I’ve been looking at several alternate reality application ideas and how to best show the real world on the phone. It’s easy to get the camera preview to show up in a WP7 application, but sometimes you want to maximize the camera preview in the screen. One problem is that the camera preview is a different size and aspect ratio than the WP7 screen. The size differences are illustrated below.

 

The WP7 screen is 480x800 and the camera preview is 480x640. If you want to show controls, then you can use the extra space at the top and bottom. ...

If you missed my blog about showing the WP7 magnetometer in 3D with an XNA/Silverlight application, you can read about it by clicking here. We are in the process of putting this application in the Marketplace so you’ll be able to check it out on your phone shortly. One of the steps in the Marketplace process is coming up with screenshots of the application. You can always use the screen capture option in the Windows Phone Emulator; however, in this case it was going to take some code to emulate the magnetometer sensor. Figuring out how to take screen ...

This week our CEO, Lino Tadros, is the special guest on  the popular .NET development show, “Yet Another Podcast”. The show is hosted by Jesse Liberty, a Senior Developer-Community Evangelist on the Windows Phone Team. Jesse and Lino discuss developing applications for Windows Phone, MVVM, Silverlight, Visual Studio 11 and more. Lino also makes a big promotional offer during the interview, so if you are itching to learn a little bit about Windows Phone, you are going to want to tune in.


Grab the podcast here: http://jesseliberty.com/2012/02/06/yet-another-podcast-59lino-tadres/

Falafel Software is at it again. Offering you a chance to join one of the industry’s most recognized testing experts in a free webinar. Join our CEO, Lino Tadros, as he teams up with SmartBear Software to bring you, “Tips and Tricks for Performance, Load & Functional Testing Silverlight Apps“ on January 31st, at 1 PM EST.

Silverlight applications present their own unique testing challenges, but in this webinar you will learn how to properly use an array of tools from SmartBear Software, including TestComplete, LoadComplete, and AQTime, to verify your Microsoft Silverlight application is rock solid and ready for ...

There are some powerful data editing controls in Silverlight such as the DataForm which let you define templates for ReadOnly and Edit modes, but sometimes you just need a simple way to view and update text.  I came across a scenario in a custom application that required a simple way to view and edit text.  The solution I came up with was a "Click to Edit" TextBlock.  In the default state, the text is displayed as a read-only TextBlock, but you can simply click on the TextBlock for it to become an editable TextBox.

Here is a working example (Silverlight ...

With Christmas coming up soon, what better blog can a nerdy geek come up with than to explain how to draw a Santa hat on the WP7 using the XNA Graphics Framework.

 

I’ve been working with computer graphics on and off for most of my 20+ year career. For me, it all started with OpenGL in the early 90’s. Since then I’ve worked with DirectX and now XNA. It’s amazing how little things have changed over that time. All those frameworks are based on triangles and arrays of vertices and normals. When you learn one of those frameworks, you ...

If you’ve been programming in Silverlight for long, you may have noticed the project setting “Reduce XAP size by using application library caching” in you Silverlight project’s settings.  You may have even checked it on to see what happens.

If you did try it, most likely nothing happened.  This is because there are a few simple prerequisite steps you have to take in order to take advantage of application library caching. 

In this blog post, I’ll step you through those set up steps.  But first, why would you want to use application library caching?

 

Why Use Application Library Caching?...

When building Line-of-Business applications, we typically provide a variety of ways to search for customer or transaction data.  One of the common search types is a date range search.  Telerik provides an excellent UI control to select dates, the RadDatePicker.  

So now your application has a begin date and end date for your search and everything looks great until you realize that the end date is never included in the search results.  This is because the DatePicker control defaults to midnight on the selected day (0 hours, 0 minutes, 0 seconds, 0 milliseconds) and if you use less-than ...

With the release of the HTC Titan, I needed to update a couple of my previous blogs.

In my blog Silverlight/XNA and Correcting WP7 Attitude Alignment, I talked about how to correct for any misalignment of the Attitude sensors with the phone body. With my Samsung Focus, I found that the Attitude alignment was off by about 3 degrees, which was noticeable in my compass application. The HTC Titan does not need any Attitude adjustment; its Attitude sensors are already inline with the phone body.

In my blog Showing the WP7 Magnetometer in 3D with XNA/Silverlight, I ...

EventBoard is making waves again. Telerik just released a customer case study featuring our mobile conference companion: http://www.telerik.com/company/customers/case-studies/telerik-s-integrated-technologies-help-make-falafel-s-eventboard-solution-a-hit-with-audiences.aspx

When Telerik asked if we wanted to be part of a customer case study, the answer was an enthusiastic yes! At every turn, EventBoard utilizes a Telerik solution. The WP7 mobile application uses RadControls for Windows Phone, the administration application uses RadControls for Silverlight, and even the product webpage features blogs powered by Sitefinity.

Thanks to the Telerik controls, EventBoard for Windows Phone continues to shine as a model of style and usability. Expanding the use of  Telerik’s  Window’s Phone Controls in ...

I’ve always been interested in 3D graphics and wanted to investigate the capabilities of the WP7. As an engineer who has dealt with sensor technology most of his career, I was also interested in investigating the sensor capabilities of the WP7. Using the Mango Teapot as an example, I came up with a simple compass application to dive into these areas. This application is a Windows Phone Silverlight and XNA Application similar to the Mango Teapot but with a 3D blue arrow that always points up and a yellow arrow that always points North.

I found that the 3D graphics ...

Microsoft’s next release of the Windows Phone operating system is here and brings over 500 new features to handsets everywhere. You can learn to build apps that leverage these new features and capitalize on the growing Windows Phone market with our new book, “Windows Phone 7.5 ‘Mango’ Nuts and Bolts”. The best part? It is 50% off through Friday! Get it now with promo code “MangoWeek”https://www.falafel.com/store/courseware/wp7nutsandbolts.aspx

Windows Phone 7.5 Mango book cover

“Windows Phone 7.5 ‘Mango’ Nuts and Bolts” is over 600 pages of step-by-step instructions, detailed explanations, and downloadable source code that will have you cranking out robust, user-friendly apps in ...