Saturday, July 31, 2010    
Blog  
OpenLight Blog
Author: Richard Waddell Created: 12/14/2009 2:45 PM
Richard Waddell on Silverlight

Source Code available here:

It took me awhile to realize that the latest Physics Helper release posted on codeplex,  Physics Helper 3.0.0.5 Alpha doesn’t support Silverlight 4. I couldn’t figure out why the physics behaviors were not available in new projects I opened in Blend 4, but if I opened the demo projects that come with the download, and referenced the same Physics Helper libraries, there they were. Long story short, the new Blend 4 projects couldn’t see the behaviors whereas the existing Blend 3 projects could. About the time I realized this, Andy Beaulieu posted a new set of source code, as Change Set 54255,  with the comment “Fixed...

Read More »

Live Example:

http://www.adefwebserver.com/Richard/ooNaEyeDevelopmentv2/ooNaEyeDevelopmentTestPage.html

I’ve been promising to get to Visual States, and this time I’m actually going to do it. In the process I cover creating a templated control from scratch, and technically I achieve my goal of not having to type in the visual states. From there I show how much control a designer has over the many versions of the UI of a templated control, entirely in Blend design view - including how to mess up the xaml if you edit the wrong thing – same choice, different menus. If you don’t already know how to create templated controls, and you want a detailed description with pictures of every step and misstep, read on:

image...

Read More »

Live Example:

http://www.adefwebserver.com/Richard/SeekerPartsAndStates/SeekerPartsAndStatesTestPage.html

I’d like to acknowledge that posts by Karen Corby made it possible for me to get to this point in understanding Parts and States.

http://scorbs.com/2008/06/11/parts-states-model-with-visualstatemanager-part-1-of/

image

In this blog I’m going to show you how to create a multi-part templated control with visual states, then how you can manipulate those parts and states in Blend.

If you’ve...

Read More »

Live Example:

http://www.adefwebserver.com/Richard/TemplatedSeeker/TemplatedSeekerTestPage.html

Probably the most significant benefit of using a ControlTemplate to contain your object’s UI is that the appearance can then be managed by designers without ever touching a line of code. Maybe I feel that way because I’m anxious to get past this visual stuff and back to what the ooNaCreatures can do, not how they look, which kind of proves my point. Anyway, to prove my claim that the Well-Templated Seeker can be changed visually without touching any code, I’ll demonstrate:

Here we are in MainPage.xaml with a seeker named defaultSeeker in the design window.

image...

Read More »

Live Example:

http://www.adefwebserver.com/Richard/ooNacontrols/ooNaControls.TestTestPage.html 

image

ooNaverse sidebars are separate projects that focus on narrow issues within the ooNaverse. In this case, the demo just shows that a Position property can be implemented in an abstract base class (ooNaThing) with no UI that inherits from UserControl and in turn be inherited by a subclass (Seeker) that does define a UI (xaml file). Clicking on the page will cause the ooNaSeeker object...

Read More »

Live example:

http://www.adefwebserver.com/Richard/TheSeekerSiteV4/Default.html

I made a lot of changes to  The Seeker, but probably the most important technically is the addition of Dependency Properties and more specifically Dependency Properties to support Animation.

image image...

Read More »

Live example: http://www.adefwebserver.com/Richard/TheSeekerBehaviorv1Site/

Ok, Silverlight is starting to freak me out a little bit. I thought it would take a couple of days to figure out how to translate my Seeker behaviors into Silverlight behaviors. After going down several paths that had too many details about things I wasn’t interested in right now, I found Falling Snow in Silverlight on Kirupa.com and the scales were lifted from my eyes in about 15 minutes. I was afraid behavior would be restricted to some short-term action-reaction thingie but not at all. After reading Kirupa’s description of a behavior’s parasitic behavior and seeing the FallingSnowBehavior literally take over a Canvas control I became hopeful  I could write a Hunt behavior that could take over my Seeker control, or at least its reaction to a SightingEvent.

image

I modified Seeker Version 1 to try this out. First I modified the Seeker so the reaction to a SightingEvent is a call to the React method on an iSighting interface...

Read More »

See it live: http://www.adefwebserver.com/Richard/TheSeekerSitev3/

After ooNaLife, I intended to just post my latest version of The Seeker so I could move on to focusing on Silverlight issues. But I had to indulge myself by using interfaces to supply the Seekers with “brains”. But that’s cool, I think it got me more in a good place to look at the MVVM model (judging from the little I know now).

image

Let me explain the on screen changes to what I now call ooNa and then I’ll get on to the code. Seekers are now red ellipses. When a Seeker ‘catches’ a Prey, the Prey disappears from the screen...

Read More »

image

See the live example here: http://www.adefwebserver.com/Richard/ooNaLifeSite/

After Seeker 2, I wanted to add a control panel, but I wasn’t clear how to tack one on. So far I’ve just slapped everything up onto the main UI, LayoutRoot, so I decided to write a new app and divide everything up from the start...

Read More »

image

Version 2.0 keeps some continuous action going by introducing Prey for the seekers to follow around. The Prey has a true graphic representation, a green circle created by choosing an Ellipse from the Asset panel, then drawing it with the shift key held down so it will be constrained to circular dimensions. The Seeker now watches its target after initially becoming aware of it through an event – which is generated when a new prey is created through a left mouse click...

Read More »

  
Copyright 2009 by OpenLightGroup.net   |  Privacy Statement  |  Terms Of Use