Oct 18
Today, I try to upgrade my first sample in this blog to Silverlight 2. Out of my expectation, the code work perfectly and actually I can run the application directly after copy and paste the files.
Anyway, there are some interesting findings when updating the code. I will try to list them all during the upgrade.
Comparison
What’s the difference?
- DispatcherTimer vs CompositionTarget.Rendering
Source codes
3D Text Space [Silverlight 2, C#] (19.5 KiB, 5,126 hits)
Silverlight
DispatcherTimer vs CompositionTarget.Rendering
In Silverlight 2, it’s much simpler to simulate the enter frame event by using CompositionTarget.Rednering. It enables you to modify the frame rate easily as well.
// C#
// New Method
Application.Current.Host.Settings.MaxFrameRate = fps;
CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
void CompositionTarget_Rendering(object sender, EventArgs e)
{
// do your stuff here
}
// Old Method
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 0, 0, 1000/fps);
timer.Tick +=new EventHandler(_timer_Tick);
timer.Start();
void timer_Tick(object sender, EventArgs e)
{
// do your stuff here
}

October 18th, 2008 at 4:14 pm
i still see the install silverlight banner:)
October 19th, 2008 at 8:39 pm
Hi, please, update your SL vs Flash gallery Silvelight examples to version 2.0 RTM..:-) Thanks
October 20th, 2008 at 12:04 am
Yup, I target to update them all by the end of this month.
October 20th, 2008 at 1:58 am
WOW
Please Tutorial for Silverlight 2 ……in here ;-)
Thank you
http://www.deva.ir
October 20th, 2008 at 2:30 pm
[...] 2. Jeff Paries reports his Project Updates for Silverlight 2, as does Terence Tsang with his Silverlight 2 Upgrade: 3D Text Space. Martin Grason has been Silverlight 2 busy with Silverlight 2 RTW, the Patient Journey [...]
November 19th, 2008 at 2:29 pm
Thanks for you public code and share idea to create 3d text space. I try to download your source code and try to run this application but i found some error about “compositiontarget”.
The error message is “The name ‘CompositionTarget’ does not exist in the current context”. Please help me to find out or find the best solution to solve this problem.
For another way, i try to go to bin folder on directly path of this application and click on the testpage.html. The page will be open and alway show silverlight link to download Silverlight 2 Beta 2 v.2.0.31005.1 .
Surely, i already get and install them into my PC. and i try to click on TestPage.html again and again. That’s link alway show to download.
Please help me!!
September 28th, 2009 at 8:03 am
[...] very impressive sample shared in Shine Draw. Texts are dynamically generated and flying in a 3D environment. You can move forward of the screen [...]
January 12th, 2010 at 8:11 pm
[...] movement algorithm I used in my app is based on Terence Tsang’s – aka ShineDraw – 3D Text Space program. Shinedraw’s web site is a true source of inspiration; you can find various Flash vs [...]