Archive for category Uncategorized
Updated WordCloud Component
Posted by whydoidoit in Uncategorized on August 17, 2011
I’ve updated the WordCloud component and added some documentation that you can find here: http://whydoidoit.com/wordcloud-for-silverlight
The new component supports individual word colouring and word angle.
Silverlight AllChildren: find all of the visual children of a FrameworkElement
Posted by whydoidoit in Uncategorized on September 2, 2010
Our application has some occasions where we need to iterate the entire child tree of a visual component. Not a common thing in many applications, I use it to pass visual states to the sub elements of a tree, but if you need a routine for this purpose then I thought I would post mine here:
public static List<T> AllChildren<T>(this FrameworkElement ele, Func<DependencyObject, bool> whereFunc = null) where T : class
{
if (ele == null)
return null;
var output = new List<T>();
var c = VisualTreeHelper.GetChildrenCount(ele);
for (var i = 0; i < c; i++)
{
var ch = VisualTreeHelper.GetChild(ele, i);
if (whereFunc != null)
{
if (!whereFunc(ch))
{
continue;
}
}
if ((ch is T))
output.Add(ch as T);
if (!(ch is FrameworkElement))
continue;
output.AddRange((ch as FrameworkElement).AllChildren<T>(whereFunc));
}
return output;
}
The function is an extension method that uses the generic Type to decide on the types of children to return. It takes an optional “Where function” that can be used to stop iterating down branches of the visual tree – please note that the Where function doesn’t only get passed the Type components, it gets everything so you can stop the recursive operation when you want to. If you don’t pass the Where parameter then all visual children are returned.
foreach (var c in panel.AllChildren<Control>((child) => !(child is FdTreeViewItem)))
{
VisualStateManager.GoToState(c, "FlowSelected", true);
}
Finally got my file hosting sorted out!
Posted by whydoidoit in Uncategorized on April 12, 2010
Why is it that every damn file hoster I try is just rubbish. Either they don’t work or they put everyone through the wringer to get at the damn file.
Ahh well, sorted now, got my web host configured, so anyone downloading from this blog will be pleased to find there are no longer any hoops to jump through

Mike Talbot is Chief Visionary of 3radical. He started his career as a game programmer working for UbiSoft and Electronic Arts among others. Currently he is programming mobile applications in Javascript, HTML5 and ASP.NET.
email: 