Nov
18
A session that caught my eye from PDC was a session titled Behavior driven development vs Test driven development. I don’t think this session had direct ties to Silverlight, however it made me think about Silverlight Behavior development. Could this be a topic?
Lately I have been a big advocate about using behaviors for UI interactions when developing a Silverlight app. Behaviors enable me to quickly develop a rich UI without much code and focus on functionality.
This is a quick thought, and more to come about it, but wanted to throw it out there. In the meantime check out
http://www.85turns.com/2009/10/14/top-5-silverlight-behaviors/
Sep
29
Problem: Silverlight 2 & Silverlight 3 do not support HTML, how can I remove the tags?
Solution: Although there are many solutions to this problem, the quickest and most frequently solution I use is a regular expression to remove HTML tags. The most straightforward example I’ve found is from John Papa’s book Data Driven Services with Silverlight 2
// Remove HTML tags and empty newlines and spaces and leading spaces
string formattedValue = REgex.Replace(value as string, "<.*?>", "");
formattedValue = Regex.Replace(formattedValue, @"\n+\s+", "\n\n");
formattedValue = formattedValue.TrimStart(‘ ‘);
fromattedValue = HttpUtility.HtmlDecode(formattedValue);
if(length > 0 && formattedValue.Length >= length)
formattedvalue = formattedValue.Substring(0, length – 1);
return formattedValue;
Sep
14
Problem: You need text to dynamically add elipses, "…", to the end of a sentence. The difficulty is how do you detect the actual length of the string. All characters are not created the same. Ten i’s != ten m’s.
Solution: Robby Ingebretsen at NerdPlusArt.com (and of Kaxaml fame) has a dynamic control that does just this. http://blog.nerdplusart.com/archives/texttrimming-textblock-for-silverlight.
The solution is very Elegant. Robby wraps a TextBlock in a Content control then manipulates the Text inside based on the size. Best of all…he as post code and an example. Thanks Robby.
Sep
14
It’s been almost two years since I started this blog. It mainly started out as a way for me to keep track of my learnings (unfortunately Evernote has taken that place). There are a number of other sites that have similar information, but that’s the point of blogs to provide information to the community.
Certainly I want to stay current and come out with latest and greatest but in doing so I’ve lost site point of my blog keep it simple and keep track of what I’ve learned. So, the next few posts will be focused on keeping it simple.
Thanks for reading and helping make this blog great.
Sep
09
Over the past six months I’ve had the amazing opportunity to work with a highly talented team (Mason Brown, Casey Britt, SmartyP, and many more) at IQ Interactive. We’ve been working on an amazing, ground breaking, Silverlight application. There wasn’t a stone unturned while developing. Items such as Pixel Shaders, custom Panels, animations for purpose (as they should be), LINQ, dynamic loading of xap, Prism, and much more illustrate the breadth of the technology. I want to share the experience/application with you so badly but it will have to wait until the end of this month.
The biggest win over the past months is not the use of technology, but the team. When I joined there was a large Silverlight project without any Silverlight knowledge. Everyone rallied, designers were brought up to speed on Blend and Flash devs were put to work. IQ now has a competent and competitive team of Silverlight developers/designers, and I am so happy to have been, and continue to be part of that.
Over the next few month, and into the beginning of next year, I will be taking on a consultant role with IQ to ensure the project sails smoothly into launch and advice with the direction of IQ’s Silverlight practice. Doing this enables me to work on a number of key Silverlight projects in the media space in Turin, Italy. Hopefully the jet lag wears off soon, because I’m ready to dig in, build awesome Silverlight projects, and most importantly build another team of kick ass Silverlight developers.
From Turin – ciao ciao
Sep
09
The other day i saw a quote from Ambrose Little that couldn’t have been more accurate about Twitters impact on my life. Simply put, it has killed my blog. Instead of blogging about smaller items or topics, it’s so much easier, and faster, for me to microblog (i.e. tweet) instead blog. From the surface it’s seems great: my time is reduced in composing, it’s now just 140 characters, and it cuts down on your time because you can quickly digest information.
I think it’s time to take a step back and really determine what should be blogged, and what should be tweeted? This will take time to answer, and there will be many opinions for both. For me I am going to start erroring on the side of Blogging.
More to come.
Aug
13
Did you know there is a built-in Trigger in Silverlight 3? It’s the the Loaded event of objects. There’s been a fair bit of attention given to Behaviors, and rightfully so, but sometimes you simply want a trigger.
It would be great to have more Triggers in SL, but for now, let’s take a look at the Loaded trigger. It’s particularly interesting because you can handle the visuals of an element becoming visible. Adding a build on (like fade in) transition to your elements in your application is something small, but adds polish, and should be encouraged.
The below Xaml shows the fading in of the LayoutRoot using the Loaded Trigger.
<Grid x:Name="LayoutRoot" Opacity="1">
<Grid.Triggers>
<EventTrigger RoutedEvent="Grid.Loaded">
<BeginStoryboard>
<Storyboard x:Name="LayoutRootLoaded">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="LayoutRoot"
Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0" />
<EasingDoubleKeyFrame KeyTime="00:00:05" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Grid.Triggers>
Unfortunately I haven’t been able to find a way to edit a Storyboard defined in a Trigger. For right now you’ll have to create the Storyboard in the Resources and copy into the Trigger.
Jul
24
Here’s a quick function on how to convert a Hex string to a Color in Silverlight. Grab the code here.

Jul
22
In a previous post I showed a screenshot of all the controls available to you in SketchFlow. The below application takes it one step further by displaying the live controls. For the record, the SketchFlow styles are re-distributable.
Jul
14
Today SmartyP (did you get that Roger, I didn’t use your name) was letting me know what Grinds his Gears which is: Why do Silverlight bloggers not embed Silverlight applications into their posts. Admittedly, I don’t have a single post that has an embedded Silverlight app.
The root of the my problem is the lack of support for embedding Silverlight into Windows Live Writer (WLW). It’s possible, with WordPress, to embed Silverlight through the web interface, but WLW’s features outweigh what the web dashboard can do (namely pasting in screen shots without having to save them to the file system and then upload).
After a little digging tonight, I came across this post by Erno de Weerd. It details how to embed Silverlight apps into Windows Live Writer. FWIW, this method uses Tim Heuer’s Silverlight WordPress Plugin.
Without further ado…drum roll…here’s the test:
Finally, completely unSilverlight related, I always reference Grinds his Gears. It’s such a great line, you can complain without complaining.