Silverlight Game of Life

December 16, 2008

Microsoft just started โ€œ<10kโ€ coding challenge with grand prize of pass to the MIX09 event, 3 nights at The Venetian Hotel and a $1500 Visa gift card! The rules are simple โ€“ develop cool WPF or Silverlight application with total sources under 10 kilobytes of code :) The submissions gallery here Iโ€™ve just submitted my entry: Silverlight The Game Of Life   ...

Silverlight Tip: How to Inject and Execute JavaScript Function(s) on-the-fly from Silverlight

December 4, 2008

Today Iโ€™ve been asked by colleague how to inject and execute JavaScript functionality from Silverlight application to the HTML DOM of hosting page. Well, things are pretty easy. First we need to get JavaScript from somewhere. In colleague's case it was an embedded resource, in my sample Iโ€™ll use TextBox to accept the script code. Also Iโ€™ll accept function name and parameters from UI. From here we have two approaches: to Eval the function code or to create โ€œScriptโ€ element dynamically. First approach is very straightforward: ...

Quick Silverlight Tips: Control Reflection, Control Properties Data Binding, Window Title and Status Bar text (IE only)

December 1, 2008

Well it was pretty long time since my last post hereโ€ฆ I was busy, mostly doing consultingโ€ฆ Now the pressure is eased of alittle, so I hope to write here more.   During this time I heard a couple of questions from clients which were pretty easy to solve but possibly still not obvious. My first tip today will be about โ€œhow to produce reflection under text boxโ€ and โ€œemulate PropertyBindingโ€ (like it worked at WPF) To produce reflection (in case of TextBox) I built Vertical StackPanel with desired TextBox and TextBlock with applied ScaleTransform....