TechDays Sweden 2011 is currently under way. The conference is powered by EventBoard. Mobile devices, including Windows Phone 7, iPhone and Android are running EventBoard, and the data is hosted in EventBoard’s cloud. In addition, the EventBoard data is served up on the TechDays ASP.Net site.

Attendees can use the software to plan attendance, bookmark favorites, and rate their sessions.

The task at hand is more complicated than it sounds. Normally you would just generate a button in Paypal and paste the form code to your website. If it were only that easy. Try doing this in any ASP.NET website and you will run into a big problem... no nested forms allowed!

The issue here is that ASP.NET websites are wrapped in a single form by architectural design. This is what the folks at Microsoft came up with when dreaming of ASP.NET. This sounds like a good idea - wrap the website in a form so EVERYTHING gets posted back... ...

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”.  ...

In my previous post, we went over a strongly typed generic attached property that could be attached to an associated object to create Blend like behaviors.

Starting with the AttachedPropertyAssociatedObject abstract class from my previous post, let’s say you have a Telerik RadTabControl that you want to disable navigation to other tabs from the selected one just by setting a Boolean property. The basics for this behavior are to iterate through the items of the RadTabControl and set the IsEnabled property to false, unless it’s the SelectedItem. Then, to undo it, you just re enable all of the ...

I’m a big fan of attached properties as you can tell from my previous blogs Using a Generic Custom Attached Property Part 1 and Using a Generic Custom Attached Property Part 2. This blog could be part 3 in a way because it builds upon my work on generic attached properties. Attached properties can be used not only to store information but also to bring about custom behaviors to the objects they are attached to, which makes them like Blend behaviors  but much easier to set in both XAML and code behind.

I found a design pattern I liked ...

In my last Blog, I provided some code to get the response data from a form and show it in a list box. I know at least one person had the question, "Where do I put this code?". That's actually a very good question and made me take a step back and think about website developers just getting started with Sitefinity 4.0. Sitefinity is quite powerful and using only the Sitefinity Administrator you can do many things. However, if you need to do custom coding that requires using the Sitefinity API, I'll provide detailed steps to show you how ...

Falafel Software is pleased to announce that our popular EventBoard mobile solution is being used for the Midwest User Group Spring 2011 Conference in Oak Brook, IL, next week.

MWUG is the largest independent user group for QAD's manufacturing management and Enterprise Application software. The conference agenda is here.

MWUG chose to use Falafel’s EventBoard for all their User Group Conferences going forwards. EventBoard is the low cost, hassle free way for conference organizers to bring their conference catalog to life on a mobile device, supporting iPhone, Windows Phone 7 and Android handsets. Conference data is stored in the ...

What makes RadDomainDataSource MVVM friendly and why did Telerik build it? In his excellent blog "An MVVM Approach to Telerik Domain Services for Silverlight", Rossen Hristov says:

"I truly believe that every time someone places an UI element or a control in his view model, a baby kitten dies somewhere."

Here at Falafel, I do believe its company policy not to kill kittens and our code base must reflect this. The secret sauce that allows us to move DomainDataSource functions cleanly into the ViewModel is the QueryableDomainServiceCollectionView (QDSCV) class. RadDomainDataSource is simply a control wrapper around the QDSCV ...

Fans of Internet standards, rejoice!  Today Microsoft officially brings us Internet Explorer 9 which scores a 95 out of 100 on the ACID3 test and passes the CSS Selectors Test with flying colors.  It’s worth noting that IE9’s ACID3 score is one point more than the current version of Mozilla’s Firefox, but still five points below Chrome and Safari.  Many developers will also be very happy to know that this latest offering from Microsoft implements many of the new features of HTML5!

To me, IE9 is a story of Microsoft finally starting to catch up to the other browsers, but ...

I have long been a fan of LinqToExcel, available on Google Code here. It makes reading an Excel file a breeze. There are lots of different ways to write the code, but it can be as simple as this:

var excel =  new ExcelQueryFactory("excelFileName");  
var indianaCompanies =  
  from c  in excel.Worksheet<Company>()                         
  where c.State ==  "IN"  
  select c;

I recently needed to set up some C# code that would send out password reset emails using an external SMTP server. I was familiar with using the built in .NET framework MailMessage class, introduced in .NET 2.0, along with it’s buddy the SmtpClient. You can easily set the port and host of the SMTP server, and send messages, including HTML mail, attachments and al the other basic necessities of emailing. You can also set the SmtpClient.EnableSSL property to use SSL for your communication with the SMTP server, which is exactly what I needed to do.

Now, since the service ...

Expression Blend 4 makes invoking a Command, drag-and-drop simple. Working in Expression Blend 4, I have a project with a "MyCommand.cs", "MyViewModel.cs" (both from the Using Commands and MVVM blog project) and an unbound button on the main form:

In Blend, click on the Assets tab and select the Behaviors item in the list. The list contains both "Actions" and "Behaviors".

Actions vs. Behaviors

Silverlight differentiates between "Actions" and "Behaviors". Actions use "Triggers" (e.g. events, storyboard state changes...) to initiate commands, property changes or some other outcome. For example, a mouse Click event can trigger a command execution. "Behaviors" are similar to ...

To separate business action logic from presentation in a Silverlight app, you should be using commands. The logic for "Save Document" or "Post Invoices" really has no place in the page code behind, and certainly doesn't need to show up twice when invoked from both a button and a menu. Commands encapsulate logic for some business action, e.g. "Save Document".  that can be bound declaratively in XAML. Commands also fit neatly into the MVVM pattern where the command itself lives in the ViewModel.

To create and use a command:

  • Create a class that implement the ICommand interface. 'Easy-peasy' -- ...

In this tutorial, I’ll show how to build a custom form control for Sitefinity 4.0 from scratch, while showing each step of the process and explaining some of the main gotchas you may encounter on the way. You can download the final project source code here. The tutorial is fairly long and is broken up into 7 parts in order to make it more digestible:

Part 1: Intro to the Form Module

Part 2: Setting up the Project

Part 3: Populate the Control Template (NamedTextBox.ascx)

Part 4: Populate the Client Script File (NamedTextBox.js)

Part 5: Populate the Class File ...

If you've started working with Form's in Sitefinity 4.0, you probably already know that your response data is persisted for you in your Sitefinity database in a table the Sitefinity engine created for you automatically. Let's suppose you'd like to get access to that data in your code-behind to use it somewhere else in your website.

The first step in this process is to determine the form name and your form widget's underlying fieldname. For more information on setting the names of the columns or finding the table in your database where the form's response data is stored, you should ...

UPDATE May 4, 2011: It was brought to my attention that there was a typo in my code below, but it is now fixed.

I sometimes find it necessary to walk the visual tree of controls in Silverlight (or WPF) at run-time.  The VisualTreeHelper class provides some nice functionality for doing this.  However, using the VisualTreeHelper can sometimes require a little too much code, especially when I want to search the visual tree recursively. 

For this reason I created some simple extension methods to do the recursing for me.  Let’s cut right to the chase.  Here’s the code:

In this video, building a new Template in Sitefinity 4.0 SP1 is demonstrated using a sample template from FreeCssTemplates.org, using Visual Studio 2010.

I demonstrated the reason behind the new location of “WebSiteTemplates” under App_Data and the easiest way to perform the transfer of an existing non-Sitefinity template to Sitefinity 4.0

 Hope you enjoy!

I am using a variant of the Silverlight Business Application which provides a nice modal dialog box for login.  For my application, the user will always need to be authenticated, so I added some code to MainPage.xaml.cs so the dialog opens as soon as the page is loaded:

  1. if (!WebContext.Current.User.IsAuthenticated)
  2. {
  3.     // Show login dialog automatically
  4.     LoginRegistrationWindow loginWindow = new LoginRegistrationWindow();
  5.     loginWindow.Show();
  6. }

 

This works great, but I also want the UserName TextBox to be focused automatically so the user can enter their login information without having to click in the TextBox.  My colleague, ...

You can perform string comparison operations using the Dynamic Linq library by invoking string methods, but by default the string comparisons are case-sensitive, which is generally not desirable when performing dynamic queries. The problem is solvable, but the solution is not immediately obvious, or at least it wasn’t to me. Here is a little sample code and data to illustrate the problem:

namespace ConsoleApplication1
{
     public  class Falafel
    {
         public  string Name { get; set; }

         public Falafel(string name)
        {
            Name = name;
        }
    }

     class Program
    {
         static  void Main(string[] args)
        {
            List<Falafel> falafels =  new List<Falafel>(...

Adding the ability to dynamically slide an image around with the mouse is not a big deal and can add a cool dynamic to your Silverlight page. You can see an example at the bottom of our Event Board page - http://falafel.com/event_board.aspx.

This is just a very wide image with a Storyboard that is updated dynamically with code behind. The trick is to get the left and right scrolling math right to give you a smooth Storyboard animation no matter what you do with the mouse.

The XAML is very simple:

<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"...