Writing the script for blackjack is pretty simple. So, the trick here is take advantage of what you can do via markup in HDi (see my last post). If you open this project up (a zip file is attached at the end of this blog) you will see that the only time the script modifies the markup is to change the value of the bet and the bank (setting state), to update the value of the hand total (again, setting state), and to set the background frame of the card container (this is the only time style is ever changed via script). Buttons focusing or disabling, divs hiding, showing, or moving is all done via markup cues triggered by XPath variables.
Suggested upgrades (read: exercise for the reader) to this app include:
One of my favorite HDi apps was blackjack , so I have been just itching to turn it into a Silverlight