App Store!

One of my recent projects made it to the App Store!

I had the honor of working with Pete Richardson and Spectrum Health on an iPhone application that provides mobile access to some pretty cool tools if you’re a Spectrum Health patient.

If you have an iPhone, go check it out - its FREE!

http://itunes.apple.com/lv/app/myspectrum/id396885759?mt=8

Posted on by daniel
Filed under: general | No Comments »

webhost4life sucks

i hate them. at one point in time, they were a top notch company. now they’re inefficient, poorly run and they seriously lack the technical expertise to adequately host a website.

The ‘online tech support’ is predictable and useless. Here’s my latest conversation with them:

Nancy Mills: Hi Daniel. My name is Nancy Mills, how are you today?

daniel: hi nancy. last week our sites went down for 2 straight days. they were brought back up. but now..they’re back down. can you bring our sites up? if we can’t have our sites up immediately i’ve been asked to move the domains from wh4l and immediately close the account.

Nancy Mills: I apologize for any inconvenience this has caused you.

daniel: i think you guys have that line set to a macro

daniel: its always the first reply

daniel: can you bring the site/server back up or do you just ‘duplicate the issue’ and create tickets?

Nancy Mills: I have checked your websites and was able to replicate the issue. Hence, I have re-opened the ticket #6856470 and updated the information you have provided. Our specialist will work on the issue and you should hear from them soon. You can check the status of the Support ticket at http://www.webhost4life.com/member/sconsole .

Nancy Mills: One of our specialists will contact you soon with the information.

daniel: thats what i figured

daniel: why have online tech support if you cant actually fix anything?

I’m done with these guys. What a way to run a company into the ground and ruin a great reputation.

Posted on by daniel
Filed under: Uncategorized | 6 Comments »

Hockey Photography

I’m addicted to hockey. I’m not afraid to admit it. I’m fully self aware of my disorder. And for me, the greatest collaborative hobby that I can have is to combine my love for photography and my passion for ice hockey. Now I’d like to preface this post with the disclaimer that much of this is still new to me. I’m simply passing on a few tidbits of information that I’ve had to dig up for myself as the internet is a little light on hockey photography information.
MikeyAlso, I don’t take pictures for a living. I write software. When I’m not coding, I’m rink-side. I have an 11 year-old goaltender and that’s been the catalyst for my new addiction. I’ve also had the opportunity to take hundreds of pictures during the home games for Davenport University in Grand Rapids, Michigan. And thats ultimately the key to learning this particular field of photography. Repetition. Take A LOT of pictures!
In this post we’ll cover a few starter tips to help bring your images up a notch or two.

Ok…on with it…

White Balance
So maybe you’re taking a ton of pictures and you’re like me, sitting at the computer later wondering they’re all orange or blue? These are two of the biggest issues that I see when looking at other amateur hockey photographs across the internet.

Hockey Photography Hockey Photography

The primary reason for these discolored images is the White Balance settings on your camera. The lighting in most rinks (outside of NHL and NCAA) is generally not photo-friendly. And the type of lighting is a tungsten based light source and tungsten has an orangish hue to it. You can accommodate this by setting a custom white balance. On most DSLR’s, you’re able to set a custom white balance by taking a test image of something white. I like to get a clean shot of the ice and use that as my base white balance. If you’re not able to do that, try setting the WB to tungsten and see if that gives you a balanced image. The blue hue is generally the result of flash photography mixed with an inappropriate ‘Scene’ mode. Some Auto settings will pop off a blue image as well. Your best bet, if possible, is to set your custom white balance.

The Glass
I’ve been blessed with the opportunity to shoot from a ladder just above the glass. For rinks with trivial lighting, this is huge. If you’re not able to do that and you find yourself shooting through the glass, understand that you’re going to lose 1-2 f-stops of aperture shooting through the transparent puck stopper. Assuming that you can find a spot that’s not riddled with puck marks, try to get your lens as close to the glass as possible. That cuts down on the lighting glare that will force your camera to try focusing on the glass in front of it. If there’s not a clean spot - make one! I keep a small container of ‘goo gone’ and a small container of windex in my camera bag. I hit the glass with the goo-gone first to remove the scuffs and then the windex for a good clear shot. Depending on the rink’s layout, you might luck out and get a chance to clean the glass on the inside of the zamboni doors while he/she is driving laps and flooding the rink. With the gate swung in, you can hit both sides of the glass and get a fairly clean portal to the action. After you’ve scrubbed out your spot - stay there! somebody will undoubtedly camp your fresh window to fun and you’ll have worked for naught.

Camera Modes and Settings
I shoot in Shutter Priority. Depending on the lighting, I try to stay as close to 1/500th as I can. 1/500 will stop a puck mid-air (shown below), but speed comes at a price. Setting to Speed priority will force the camera to maintain the Aperture settings on its own. On my Nikon, I also set the ‘ISO sensitivity auto control’ to ‘On’ and let it max out at 3200. What this does, is free the camera to moderate the ISO on the fly.
Hockey Photography
Now keep in mind that this is a balanced trade off. As I said, most of the rinks I shoot at have horrible lighting. Less light means that the camera has to compensate by adjusting the inbound image settings. Since I’ve told the camera that I want a set camera speed, the only other settings that can be moderated by the camera’s brain are the ISO and the Aperture size. If the lighting is moderate-to-bad at 1/500th, the computer will open the aperture as far as it can go. On my lenses that means 2.8. Once it hits 2.8, if the image is still under-exposed, it will start dialing up the ISO. Unfortunately, dialing up the ISO introduces grain to your images. Once your ISO hits 1600 to 3200 (depending on your cameras sensor), you’ll start to see the grain when zoomed in at 100%. Don’t despair over the grain, however. There are free tools out there that can help immensely with the grain. My tool of choice is Noiseware from Imagenomic. You can find a free version here: http://www.imagenomic.com/download_nwsa.aspx

Shutter Mode
I shoot in Continuous Shutter mode. As long as I’m holding down the trigger, the camera will keep taking sequential pictures and hopefully one of those is a keeper. Depending on your camera, you should be able to rip off a good series of images before the camera has to stop and buffer the shots. I also keep the camera running on breakaways and close quarter shots. You’ll have to follow the action with the camera and anticipate the big shot, the big save or the big deke. Anticipating the shot is more of an experience thing. Knowing your sport helps a lot. When you have a feel for the action that’s about to take place, you’ll know when to go trigger down on your camera. The downside of this, is having 800 images that you’ll have to go through when you get home.
Its in your best interest to keep your camera card clean of bad shots. What I like to do during period breaks is sit down with the camera and delete the pictures that are obviously bad. I’ll delete hundreds of out of focus, poorly exposed shots during a single game. I’m sure that as I become better at this, I’ll have fewer duds and more prints.

Hockey PhotographyMetering Mode
This is going to sound crazy, but I’ve tried them all and I always come back to spot metering. When trying to get the shot of the goalie through traffic, I don’t want the camera to assume that the lighting on the defenders jersey in front of the goalie (the guy that doesn’t have direct lighting) is the light metering to use and then the goalie is shadowed in the picture. With spot metering, I’m telling the camera that where I’m centered is where it should be metered.

Autofocus Mode
On my Nikon I have a few different Autofocus modes. I primarily use ‘AF-C’ which is Autofocus - Continuous. For hockey, having the autofocus motor hard at work keeping the image in focus is key for me.
For the Autofocus Area Modes, I use single or selectable. I have a little grid on my viewfinder that i can pick the focus spot on the fly. Why do i do this? On some shots, I’ll frame the goalie a bit to the right or left of center but I still want to capture the action in front. I’ll set my focus point to the left or right where the goalie is and wait for the shot. Regardless of who steps in front of the crease, I know that my autofocus process is still locked on the goalie.

RAW versus JPG
For my hockey photography I shoot RAW and not JPG. Why? RAW allows me the ability to make modifications that generally are done on camera during the shot. JPG shots will ‘dumb down’ the image and you’ll lose a bit of quality right out of the gate, just by shooting in that mode. Now when I get to Photoshop and edit the image, I’ll crop, modify and save it as JPG for the web. But the original is always there if I want to go back later for a printable shot. RAW, as you would expect, comes at a price. The file sizes are larger because more information is being stored on the card. Larger file sizes take longer to write to the card. So if you’re shooting in continuous shutter mode, your camera may need to pause and buffer the write process. High end cameras wont need to play ‘catch up’ on the file writing, but mid-low level cameras will need to pause after about 5-7 back to back shots.

NHL Quality
I envy NHL photographers. The shots they turn out are amazing! So why can’t we get those crisp, clear shots of little Billy during his Squirt playoffs? Three (maybe four) reasons:
The lighting at the NHL/NCAA rinks is insanely bright! Because they’re illuminating for the television cameras (they have lenses and apertures too), the rink has to be bright. If my son’s hockey team is traveling to play a team that uses a college rink, I’ll always take my camera. I already know the lighting is going to be great and I’ll get good shots. There are a few rinks that we play at where I don’t even put the camera bag in the car. It would be like trying to take pictures in the dark. Which brings me to a huge recommendation: Always ask the rink if the lights can be maxed out because you’d like to take pictures during the game. I know that our home rink will keep the lights around 70% for games and practices. Its enough light to play and honestly doesn’t seem that bad when you walk in. They keep a bank of lights off to conserve power. But if you ask, they just might bump all the switches up for you. On the flip side, when your game is over, let them know that you’re done and they can ‘dim’ the lights back to normal. If they see that you care about helping them save money, they’ll be open to you asking the next time.
Second reason why those NHL shots are awesome - Flash! The team photographer is wired to flash lighting that is mounted at the rink. Ever notice on the slow-mo replay shots (on t.v.) that you see the flash going off like crazy? Yeah that’s your NHL team photographer(s) ripping off a great shot of the big play.
Third reason: Camera holes. The big rinks have a hole cut in the glass for the camera lens. As mentioned above, shooting through the glass kills your pictures. Shooting through a hole in the glass is much better. Check the rink for holes. You just might get lucky and find a sweet spot!
Fourth reason but not really a reason but again…maybe it is. Its the camera! As much skill and intuition that you may possess, sometimes it is the camera that makes the shot. The higher end cameras will have less noise (or grain) on shots that are triggered at the higher ISO. I’ve checked NHL quality shots from a Nikon D3 that had virtually no noise at 3200, yet a Nikon D300s will have grainy shots for the same speed. Better sensors make better pictures.

Know your sport!
Anticipation is the best skill that you can have when taking pictures of little Billy’s game. Know where the play is going to go and have a feel for when the shot is going to be taken. If you’re really going to get that big shot, you’ll need to keep the camera up and on your eye during play. Follow the game through the lens as much as possible, peeking when you need to find the puck or the play. If you wait until the breakaway or the neutral zone forechecks to bring the camera up for the shot, you will have already missed the hit or the incredible deke. Make sure your batteries are completely charged and have back ups. My camera is up when the puck is in play.
Know your team. When I’m shooting Davenport games, I have 2-3 players that I always know when they’re on the ice and where they are. These are my shooters, big hitters and showboaters. Even when they don’t have the puck, I’m still glancing around to see what they’re up to. Behind the play shots are always exciting.

Know When to Duck!
If you’re holding $3-5,000 worth of photo goodies, a one dollar puck can destroy it in a second. I shoot from a ladder on the back end of the rink, opposite of the bleachers. It allows me to get just above the glass for the shot, but not so far above that I’m a distraction. This also puts me in the line of fire!
There are a few situations that I know are dangerous to me and my camera equipment and I’ll turtle behind the glass:
1: Power play kills where the puck is ripped down the ice. Sometimes that end of the ice is MY end of the ice. If the puck is at the other end of the rink, I’ll watch for the dump. I’d rather see it coming than feel it coming.
2: Goalies that are clearing the puck from the defensive zone. If I see the goalie come back to play the puck, I duck. Because they love to pop it out of the rink (when they’re not penalized for it), I don’t want to wear those shots either.
3: Stick checks below and in front of me. When two skaters come together on the ice directly in front of me and my perch, I duck. They’re generally too close to get a decent shot but the puck can pop up and over.
Generally speaking…be aware of the game, the flow of traffic and the path of the puck.

Conclusion
I can’t say it enough: “Take lots of pictures”! Its digital, the shots are virtually free so work that trigger. Try different settings to see what works for you. It will take a few times out for you to find your camera’s limits and what the best possible pictures that your DSLR can take for the lighting situations that you’ll find yourself in. And realize that some rinks are just plain ornery when it comes to getting a decent shot. Accept that there may be games when you simply can’t get the shot and prepare yourself for those locations where you can. Enjoy your sport and keep your eye out for those candid moments as well. Some of my favorite shots have had nothing to do with the big glove save or the hard hit at center ice. Sometimes its the skater riding off into the sunset after having been ejected from the game.
Hockey Photography

Posted on by daniel
Filed under: photography | 2 Comments »

2010 - Come get some

Ok..so this is not a New Years resolution post. I missed that timeframe by about 4 weeks. I’m hoping to project a bit into the year and envision what will pan out this year.

Changing jobs! My contract with Amway ended with 2009. So now I’m looking for work. Technology spending is down in West Michigan so this might be the dark at the end of the tunnel. I’ve had a few leads and lets hope that something lands soon. Otherwise…goodbye Michigan!

www.banditsportal.com - Side project that I’m hoping to deploy in the next few weeks. What is it? In a nutshell…facebook for goalies. Its a silverlight site that is a central community for hockey goaltenders. As many of you know, I’m very passionate about hockey. This project was a way for me to connect my love for silverlight with my obsession for ice hockey. Screenshots and stuff later this Spring, following launch.

www.drillshare.com - Another side project thats been shelved for far too long. I have a great Flash based drill drawing utility on there that I would love to convert to Silverlight 4 this year. Again…hockey site combined with Flash, Asp.Net and a ton of JavaScript.

www.hawkhockey.org - My son’s hockey organization. I volunteer a lot of my time there. Its a great father-son activity and has become an identity point for our family.

http://www.flickr.com/photos/danwoolston - My flickr photo page. I yearn to be a better photographer. I’d love to move into wedding photography, goaltending photography (yes its different from typical hockey photography) and portrait work. Check out the flickr page to see the progress I’m making. So much more to learn, but thankfully I have a network of very talented peers that can help get me to the next level.

And yes….I may be writing a third book this year. More details to come, if indeed the publisher accepts the proposal. Thats another post for another day.

Skills to add this year:
More Silverlight - as always.
Lightroom  proficiency - primarily photo workflow.
PHP - Its come up way too much when talking with potential employers. I’ve played with it before and maybe its time to come back to it.
.Net 4.0 - Its new, so therefore I must have it. Shiny.
Entity Framework - Need to get deeper. Nhibernate has been a delightful distraction, but I need to come back for some EF goodness.

Well thats about it for this post. Will keep writing as the year moves on….

Posted on by daniel
Filed under: general | No Comments »

Arggghhh!

I’ve neglected my blog for far too long!
I’ll be back with posts on Silverlight, Hockey and Photography.

Posted on by daniel
Filed under: Uncategorized | 1 Comment »

ice-t destroys a mac

So Ice-T feels the same away about Apple products that I do:

WARNING! - Bad Language and PC Destruction!

awesome.

Posted on by daniel
Filed under: Uncategorized | No Comments »

My a.d.d. nerd cave - part 1

I’ve moved my office to a finished basement room. I moved my coding station to the corner of the room. Unfortunately with this arrangement, I dont have space for the big monitors/big tv in this office. But its a good hideaway and a happy place for an a.d.d. person. Check out the picture of the coding area:

Here’s a few hide and seek things to find in the picture:

Hellboy action figure
Chumby
Wing Nut Hat
Einstein action figure
Battlestar Galactica Lunchbox
Red Swingline Stapler
Darth Stewie
Wall-E action figure
Various speaker badges on lanyards
How many Cartmans are there?

Well anyway…theres my little corner.

I’ll post more images of the other areas of the room, including the makeshift robotics lab, the sci-fi toy stuff (including a boat load of Alf stuff) and eventually my classic arcade machines.

Posted on by daniel
Filed under: general | No Comments »

critical expression blend error

I really hate this error:

Its frustrating and deflating. My xaml compiles, runs and looks ok but opening the page in Blend crashes it every single time. Other pages load just fine. Guess I’ll break the page down with comments and find the offending code. My best guess is a style reference..but I wouldn’t know, given the craptastic error shown.
Sure hope this is fixed in Blend 3.

Posted on by daniel
Filed under: Uncategorized | No Comments »

IValueConverter and Silverlight databinding

The code here is based on Silverlight 2 technology.

One of the key features for Silverlight that I’ve made extensive use of lately is the ability to include an IValueConverter in the databinding process. Recently I had an issue with the Silverlight DataGrid and the DataGridTextColumn. I wanted to override FontWeight property of my bound text column but was getting an AG_E PARSER error. Silverlight wasn’t up for having the FontWeight property bound to anything aside from a declarative value. Let me show you the process I worked through to get the right results:

First..the basic non-bold app:



Page.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace SilverlightValueConversion
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }
    }

    public class EmailMessageList : ObservableCollection<EmailMessage>
    {
        public EmailMessageList()
            : base()
        {
           Add(new EmailMessage(”Gordie Howe”, “What happened?”, false));
           Add(new EmailMessage(”Chris Osgood”, “@$###$% @#$##!”, true));
           Add(new EmailMessage(”Gary Bettman”, “Wahoooo!”, false));

        }
    }

    public class EmailMessage
    {
        private string _fromName;
        private string _message;
        private bool _isNew;

        public EmailMessage(string from, string body, bool newmessage)
        {
            this._fromName = from;
            this._message = body;
            this._isNew = newmessage;
        }

        public string FromName
        {
            get {return _fromName;}
            set {_fromName = value;}
        }

        public string Message
        {
            get { return _message; }
            set { _message = value; }
        }

        public bool IsNew
        {
            get { return _isNew; }
            set { _isNew = value; }
        }
    }
}

Page.xaml
<UserControl xmlns:data=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data”  x:Class=”SilverlightValueConversion.Page”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
    xmlns:app=”clr-namespace:SilverlightValueConversion”
    Width=”400″ Height=”200″>
    <UserControl.Resources>
        <app:EmailMessageList x:Key=”MessageListData”/>
    </UserControl.Resources>
    <Grid x:Name=”LayoutRoot” Background=”Silver”>
        <data:DataGrid x:Name=”dgMessages”
              AutoGenerateColumns=”False”
              ItemsSource=”{Binding Source={StaticResource MessageListData}}”>
            <data:DataGrid.Columns>
                <data:DataGridTextColumn Header=”From”
                Binding=”{Binding FromName}” />
                <data:DataGridTextColumn Header=”Message”
                Binding=”{Binding Message}” />
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>
</UserControl>


If you look at the data source that I’ve thrown together, you’ll see that there is also a field for IsNew, indicating that the message is fresh and unread. Wouldn’t it be great if we could turn the font of the new messages to BOLD? We’re accustomed to having that functionality in our messaging clients so it would be great if we could duplicate that here. To accomplish in place conversion of bound properties, we’ll use an IValueConverter class. The simple description of the conversion process is that we send in an object, interrogate it and return a different value for binding.
This is the code for modifying the FontWeight property:

    public class FontConverter : IValueConverter
    {
        public object Convert(object value,
                              Type targetType,
                              object parameter,
                              System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                bool isNew = (bool)value;
                return isNew ? FontWeights.Bold : FontWeights.Normal;
            }
            else
            {
                return FontWeights.Normal;
            }
        }

        public object ConvertBack(object value,
                                  Type targetType,
                                  object parameter,
                                  System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }

We send in our bound “IsNew” boolean field and it sends out the appropriate FontWeight enumerated value for binding. Now lets turn our attention to the implementation of the FontConverter.
To expose the class to our xaml code, we add a short entry to our Resources tag:

<UserControl.Resources>

<app:EmailMessageList x:Key=”MessageListData”/>

<app:FontConverter x:Key=”fontconverter”/>

</UserControl.Resources>


And then it’s just a matter of working out the binding:

<data:DataGridTemplateColumn Header=”From”>

<data:DataGridTemplateColumn.CellTemplate>

<DataTemplate>

<TextBlock Text=”{Binding FromName}”

FontWeight=”{Binding IsNew,

Converter={StaticResource fontconverter}}” />

</DataTemplate>

</data:DataGridTemplateColumn.CellTemplate>

</data:DataGridTemplateColumn>

The converter class is called during the binding process, referencing the StaticResource fontconverter class. The IsNew property becomes a parameter for the call and the output is bound to FontWeight.

Note that we’re using a DataGridTemplateColumn to do the binding now. Couldn’t we just use the previously used DataGridTextColumn and bind to the FontWeight Property? I’m glad you asked.
Let try that:

<
data:DataGridTextColumn

Header=”From”

Binding=”{Binding FromName}”

FontWeight=”{Binding IsNew,

Converter={StaticResource fontconverter}}”>

</data:DataGridTextColumn>


If we add this and run it, we’ll get this very informative message:

So yeah…you’ll want to use the DataGridTemplateColumn instead.

So here’s the complete working code:

Page.xaml
<UserControl xmlns:data=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data”  x:Class=”SilverlightValueConversion.Page”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
    xmlns:app=”clr-namespace:SilverlightValueConversion”
    Width=”400″ Height=”200″>
    <UserControl.Resources>
        <app:EmailMessageList x:Key=”MessageListData”/>
        <app:FontConverter x:Key=”fontconverter”/>
    </UserControl.Resources>
    <Grid x:Name=”LayoutRoot” Background=”Silver”>
        <data:DataGrid x:Name=”dgMessages”
              AutoGenerateColumns=”False”
              ItemsSource=”{Binding Source={StaticResource MessageListData}}”>
            <data:DataGrid.Columns>
                <data:DataGridTemplateColumn Header=”From”>
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text=”{Binding FromName}”
                               FontWeight=”{Binding IsNew,
                                Converter={StaticResource fontconverter}}” />
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
                <data:DataGridTemplateColumn Header=”Message”>
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text=”{Binding Message}”
                               FontWeight=”{Binding IsNew,
                                Converter={StaticResource fontconverter}}” />
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>
</UserControl>

Page.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Windows.Data;

namespace SilverlightValueConversion
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }
    }

    public class EmailMessageList : ObservableCollection<EmailMessage>
    {
        public EmailMessageList()
            : base()
        {
           Add(new EmailMessage(”Gordie Howe”, “What happened?”, false));
           Add(new EmailMessage(”Chris Osgood”, “@$###$% @#$##!”, true));
           Add(new EmailMessage(”Gary Bettman”, “Wahoooo!”, false));

        }
    }

    public class EmailMessage
    {
        private string _fromName;
        private string _message;
        private bool _isNew;

        public EmailMessage(string from, string body, bool newmessage)
        {
            this._fromName = from;
            this._message = body;
            this._isNew = newmessage;
        }

        public string FromName
        {
            get {return _fromName;}
            set {_fromName = value;}
        }

        public string Message
        {
            get { return _message; }
            set { _message = value; }
        }

        public bool IsNew
        {
            get { return _isNew; }
            set { _isNew = value; }
        }
    }

    public class FontConverter : IValueConverter
    {
        public object Convert(object value,
                              Type targetType,
                              object parameter,
                              System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                bool isNew = (bool)value;
                return isNew ? FontWeights.Bold : FontWeights.Normal;
            }
            else
            {
                return FontWeights.Normal;
            }
        }

        public object ConvertBack(object value,
                                  Type targetType,
                                  object parameter,
                                  System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}

We run the complete code to get our working grid:

Obviously the grid could use some styling love, but this should get you started on using the IValueConverter. Keep in mind that you can use this thing for quite a few other binding tasks:

· Dynamically set coloring based on database properties

· Compile DateTime fields into custom descriptors

· Conditional testing and output

· many, many more…

You can download my sample solution file HERE.

Posted on by daniel
Filed under: Uncategorized | 1 Comment »

Quick config for Silverlight in SharePoint 2007

As promised during the Sharepoint User Group presentation on Silverlight in SharePoint:

Configuring SharePoint for Silverlight Development Checklist(’ish)

PreReq’s:

  • Windows 2008 OS installed and running with appropriate roles/features
  • SQL Server installed and runningWSS 3.0(sp’d)
  • Visual Studio 2008(sp’d)
  • VseWSS (1.2 or later):
    http://www.microsoft.com/downloads/details.aspx?FamilyID=7bf65b28-06e2-4e87-9bad-086e32185e68&displaylang=en
  • Create your Web Application and a Test Site.
  • Test that your site works.

I’d recommend backing up your VHD at this point, just in case things go awry. And they will. Especially the night before your demo the technology. Not that I’m speaking from experience or anything.

Silverlight Preparation

  • Install Silverlight Tools and the Toolkit:
    http://www.silverlight.net/GetStarted/
  • Make sure that your IIS installation has the MIME type for the .xap extension:
    Extension: .xap
    MIME type: application/x-silverlight-app
  • GAC the Silverlight .dll *:
    The .dll is most likely located at:
    C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server
  • use Gacutil or filesystem to get the dll into Windows\assembly

    *don’t forget to do this as Administrator.

Configure the Web.Config file:

Backup your sites web.config file!

Here’s a trick that worked on my new vhd and if it doesn’t work for you, hit the web and

search for ‘configuring sharepoint for silverlight’ and you’ll find the hard .config entries for the complete file. In an attempt to do a quick ramp up of the process, try this:

Open Visual Studio 2008.

Create a new Web Site, targeting the 2.0 Framework:

Open the new sites web.config file and delete the contents.

Copy the entire contents from your SharePoint web.config file to the site’s file.

Save it.

Right click on the site project file and select PropertyPages.

Click on Build and change the targeted framework to 3.5:

Add the next few options to the sections as noted:

<system.web><compilation><assemblies> :

<add assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

<system.web><pages><controls>:

<add tagPrefix=”asp” namespace=”System.Web.UI.SilverlightControls” assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

Copy the config contents over to your SharePoint web.config file, replacing the

contents. Save the file.

Reset IIS.

Your Sharepoint environment should be ready to rock and roll the Silverlight development.

My next post will cover a short Silverlight web part built and deployed to SharePoint. Stay Tuned!

Posted on by daniel
Filed under: Uncategorized | 1 Comment »
continue: Next