New in Silverlight 3: Perspective Transforms

3d Perspective Transform

In addition to the transforms that were available in Silverlight 2 (translate, skew, etc.) you can now apply perspective transforms to any Silverlight Element to create 3D images and animation.

We have a two part video on how to do this on Silverlight/Learn

3d perspective transform.3dDemo

 

While 3d may at first seem like more sizzle than substance, in truth it can buy you precious real estate on your front page, above the fold by allowing you to put supplemental but important information on the “back” of objects.

[ Working Example Follows ]

Next: Based on styles      

 

Posted in z Silverlight Archives | Comments Off on New in Silverlight 3: Perspective Transforms

Hey! There Is Such A Thing As A Free Lunch!

image You have to respect a man who believes in his message. 

Chris Anderson, author and editor in chief of Wired Magazine , and formerly Internet Editor at the Economist,  has followed his best selling book The Long Tail: Why the Future of Business Is Selling Less of More with a new book titled Free. 

 

While his premise is interesting, if not totally original, he certainly earns points for putting his money where his words are.

Amazon is selling the hardcover edition at list price:

FreeHardCover

On the other hand, the Kindle edition is marked down…  well, all the way:

 

FreeKindle

 

FreeInvoice

 

Sweet.

Posted in z Silverlight Archives | Comments Off on Hey! There Is Such A Thing As A Free Lunch!

What’s New In Silverlight 3 – Wiki Released

All our blogs are alive with information about the release of Silverlight 3 and I couldn’t have a happier birthday present.  For the past couple weeks I’ve been working on a new, experimental contribution to the effort and I’m thrilled to release it, the ever evolving and growing What’s New In Silverlight 3 Wiki

Posted in z Silverlight Archives | Tagged | Comments Off on What’s New In Silverlight 3 – Wiki Released

Organizational Chaos Followup

About a month ago I wrote about getting organized.  Since it is Sunday and I’m saving my big announcement blog entry for tomorrow morning <smile>, I thought I’d take a moment for a not-so-quick follow up.   

Two Philosophies Lead To A Unified Approach

Some years back I found myself with the strong conviction that what worked (for me) was this: “Don’t organize on the way in, search on the way out.”

Every time I forget this premise, and fall back into the habit of creating dozens of small categories in which to stash things away, I end up with lots of mis-filed papers and socks all over the floor.

[By the way, I have no idea if that was an original insight, or one that I swiped from Ed Belove, probably when he described Lotus Agenda. (So many of the good ideas I’ve heard over the past couple decades were actually Ed’s.)

Since I last wrote, I discovered what is probably the only popular self-help book I fpimd worth the cover price (though I still think it could have been edited down to a white paper):  Getting Things Done by David Allen.  Of course I’m not the first to discover GTD (as it is known); the book is a massive best seller (which I admit is often a bad sign).

More related than might appear at first, the essential message of GTD , at least as filtered through my brain, is:  “The more you keep in your head the less you can think about what you need to do so get absolutely everything you have to do or remember out of your head. The only way you can do that is if you have a system you trust 100%.  You must trust that the system won’t lose anything, and you must trust that the information will be there (proactively in my case) when you need it.  That is to say, you have to trust that the information will be stored more reliably and retrieved more reliably in the system than it would be in your head.

This apparently is a hurdle for a lot of folks, but I have absolutely no problem believing that a well designed system, properly backed up can do that. I’m reasonably convinced that silicon is faster and more reliable than meat.

Once I dump all my tasks, trivia, notes, things to remember and things I have to do but not yet into a sufficiently reliable system, I’m freed up to do what meat does much better than silicon: set priorities and make judgments.

Assembling the Right System

The time for writing my own system has passed. There are enough pieces out there that it is just a question of finding them and plugging them together. That took a little doing (and this real intention of this note is to save you the work of recreating that experience!)

For a while,  every “solution” created more problems than it solved.  But with a bit of refinement and a willingness to spend more money on applets than one would think possible, I believe I have found solutions that meet the specifications: they allow me to keep virtually nothing in my head that isn’t relevant to something immediately actionable, yet with total confidence that what I need will be immediately retrievable when needed. Even better, the system will alert me when that time arrives, and since I’m notoriously unaware of time passing that is a very good thing indeed (I asked my wife if it was lunch time yet, at 11pm just last week). 

Stringent Requirements:

For me to turn over so much responsibility to any system, I must have an enormously high level of confidence, and thus the system must meet the following outrageous set of requirements.

Information: Be able to save any bit of information that I receive or stumble upon in email, on the web, in conversation, in IM, on the phone, while driving, in short: any where at any time,  and store it 100% reliably and be able to retrieve it no mater where I am, with at least 95% fidelity,  in less than 3 seconds.

Responsibilities: Capture every task
, personal and work, instantly and then let me forget them until it is possible to take an action, and then alert me immediately that an action is both possible and necessary.  Allow me to set priorities and to aggregate tasks into projects, and to add these tasks from anywhere at any time and to be alerted to and to retrieve them no matter where I am.

Email: Manage the 3,000 email messages I get every day so that I spend no more than 20-30 minutes a day reading my email,  but see everything important and never miss a critical email and so that I can retrieve any email I need within 3 seconds.

I could certainly have treated E-Mail as just more Information but it was much more efficient to treat it separately.

 

Information

I have to start by saying that I’ve built and bought at least a dozen systems that tried to meet the Information requirement. I believe it took the perfect storm of the Web, and massive advances in mobile phone technology to finally make this all work.  My solution here is centered around a single application: Evernote. The next image is Evernote running on Windows. I tend to throw just about every note into a single folder (cleverly named notes).  I make an exception for a few very obvious specialty notes such as business cards, passwords and my favorite: short term memory, the notebook in which I record my hotel room, where I left my car, etc.

EverNoteWindows

I can retrieve this information (or enter new notes) instantly on the Web,

EverNoteFireFox

or, even better, right on my phone:

ever

EverNote provides a clipping application that allows me to grab any highlighted text anywhere and just add it, or drag and drop into evernote, but my favorite feature is that I can take a picture and Evernote indexes the words in the picture, which I can then search for.  Hmmm…. I know we stopped at a good place to eat in Brewster on the cape; didn’t I take a shot of it for Yelp? Let me search…

brewster coffee

In less than a second it finds my picture and while the red arrow is mine the highlighting is provided by Evernote.  Very nice.

Spec:

image Be able to save any bit of information that I receive or stumble upon in email, on the web, in conversation, in IM, on the phone, while driving, in short: any where at any time,

image store it 100% reliably

image be able to retrieve it no mater where I am,  

image in less than 3 seconds.

[I’m going to table the issue of adding notes from the car for the moment, but see my discussion of Jott below)

Responsibilities

This is the hard one. I recently tweeted that working for Microsoft is like learning to juggle a dozen razor sharp plates a dozen razor sharp plates, while riding a unicycle on an escalator”

I’m told that many people feel that their memory leaks a bit, mine seems to leak a bit more than usual.

 

Young man kayaking down waterfall

Keeping track of my myriad projects, deadlines and responsibilities is critical to meeting the expectations of my bosses, peers, clients (that would be you) and myself. But I’m happy to say that David Allen says that trying is a losing strategy. Once again, the right answer is to turn it over to a system you trust. So I set off to find a 100% reliable system. 

I’ll spare you the details; the solution I found uses a back end web-based service with a phone-based front end, augmented by a call-in transcription service.

The backbone; the engine that makes it go and makes it available from everywhere at all times, is the unfortunately named Toodledo. The Toodledo interface is not simple, but it is powerful and it supports everything I need and then some. In fact, I switched from Remmeber the Milk (which I very much liked) to Toodledo because the latter was a much better fit with GTD and with the approach I as formulating.

 

Toodledo

Toodledo has three key features:

  1. It understands projects and sub-projects
  2. It works and plays well with the ToDo application that I use on my phone
  3. It is more than happy to sync with and to notify you of upcoming events by SMS, its own iPhone app, email, fireFox, twitter, Google, iCal, netVibes, pageFlakes, rss, jott, tSheets, outlook, VistaGadgets or Android. Pretty good

 

Toodledo is almost enough, but I need something much more immediate. To accomplish that, I added to vital pieces of software. First: ToDo:

ToDo

 

Appigo’s ToDo is a wonderful iPhone application for ToDo lists and project management, and is especially rewarding if you follow the GTD method as it understands projects, sub-projects, priorites, and most important Context (where you must be to act on a problem – no point seeing that you need to update the blog if you’re not near a computer.

I take it back, most important is that if you assign a due date and time ToDo will notify you. My one feature request would be to add a reminder date/time that is not the same as the Due date/time, but that is just a quibble.

 

The same set of tasks seen on the ToodleDo, looks like this on ToDo

 

 ToDo-Iphone

Almost There, but What About Ideas and Tasks that come to you on the highway?

The one missing piece in all of this is the requirement that I  be able to capture data and tasks any time, any where.  For a long time, it went like this: someone would ask me to do something (during a call) or I’d think of something important and then I’d face an interesting dilemma: which was the better choice:

  1. Wait until I could get off the highway to write it into my software by which time I was certain to have forgotten at least one important detail if not the entire reason I’d gotten off the highway in the first place

iStock_ Shrugging Man Medium

The second choice is to try to enter the information into my phone while driving 65 miles per hour among Massachusetts drivers

 

iStock_SadGirlverySmall

The answer is Jott. . Jott is a dictation service that lets you call in (or send a message from their phone app or their desktop app).They then transcribe your message and send it to whomever you like, including Evernote or Toodledo. Tweter, Outlook or any of your contacts.

 

jott

There are limitations to Jott’s voice recognition (see this article) but all in all it is just great. I can say “Jott ToDo” and add to my todo list while driving, such as “Jott Todo, pay speeding ticket”

GTD Bliss

Together, ToDo, Toodledo and Jott make a system that completely meets the GTD requirement: I can put every task, big or small, into the system with 100% assurance that I won’t lose it, miss it or have to think about it until it is time to think about it.

Spec:

image Capture every task, personal and work, instantly

image let me forget them until it is possible to take an action

image alert me immediately when  an action is both possible and necessary 

image Allow me to set priorities

image and to aggregate tasks into projects,

image and to add these tasks from anywhere at any time

image and to be alerted to and to retrieve them no matter where I am.

 

 

Email

I get about 3,000 emails a day and that is enough to treat Email separately.  Just a little analysis shows that my email breaks down (roughly) as follows:

  • About 2/3 comes from valuable lists but is not directed to me and is not immediately actionable
  • About 80% of what is left have me in the To or CC list but are not really to me specifically. I need to read them but most are FYI and while important to someone are not critical to me
  • We’re now down to 20% of 1/3 or a select 200 of the 3,000 daily messages. These 200 look important but only 1 in 10 really are. But those 20 message  must not be missed!
On any given day the proportions will change, unpredictably, but I strongly suspect that overall there is a normal distribution,  and further, what I’ve described is well within one standard deviation. What’s more, I’m wiling to bet, based solely on experience that this describes the contents of most corporate email inboxes.

 

The Best Laid Plans of Mice and Men

You may remember that my first approach was to have just 5 mailboxes:

  • Inbox
  • Act  (take action on this email)
  • Waiting  (pending someone else’s action)
  • Reference  (hold for future blos or videos)
  • Archive (can’t do anything with this now, hold on to it)

This lasted less than a fortnight. . There was just too much email to sustain it. 

I then created “rules” in Outlook to separate out the newsgroup emails and other chaff that I knew I could defer.  Worked fine until I found I had missed some pretty important emails. 

I’ll save you all the interim steps, and skip to the solution that is now working quite well.

Email Working…

Step 1, I created a small but vital second contacts list called VIP.  In it, I put the v-cards for anyone who I work for, work with or who is associated with a project I’m working on. Then I added anyone else whose mail I must not miss.  I will not be publishing this list 🙂

Step 2: I created these mailboxes:

  • Inbox
  • VIP
  • VIP Urgent
  • Probably Not Urgent
  • Reference
  • Read
  • Discussions (under which are any number of mailboxes for each discussion area)

Every single message that arrives is copied to read and marked as read, and thus I can count on having a copy. 

Each of the following rules has an Except clause that reads: Except if my name is in the to or cc field or the sender is in the VIP list. 

There are then a series of rules, with that except clause that copies mail for discussions to the appropriate discussion and out of the inbox.

VIPRule

There is an additional rule that essentially says that if it is not for a discussion and doesn’t meet the exception criteria, put it in the “probably not urgent” folder.

Finally there are two vip rules, anything that is from someone on the VIP list that is marked urgent goes to the VIP urgent list and a template is used to send an SMS to my phone.  Anything that is from a VIP but is not urgent goes to the VIP folder. And then anything to me or cc to me but not vip stays in the inbox.

I can now read my messages in just the order I want, deleting as I go safe that a copy of everything is already in “Read”

1. ViP Urgent and VIP – never miss a message from a VIP again
2. Inbox  – read everything addressed to me
3. As time allows skim Probably not urgent and the discussions

Save anything I might want to come back to in reference and/or copy it to Evernote (discussed below) and/or make an entry in ToDo (discussed below).

All of this is supplemented by Copernic, an extraordinary search engine that is able to retrieve the messages I need in the specified amount of time, along with any matching files, contacts, images and so forth,

Copernic

Email: Manage the 3,000 email messages I get every day so that I spend no more than 20-30 minutes a day reading my email,  but see everything important and never miss a critical email and so that I can retrieve any email I need within 3 seconds

Spec:

image Manage the 3,000 email messages I get every day

image I spend no more than 20-30 minutes a day reading my email

image I see everything important

image I never miss a critical email 

image I can retrieve any email I need within 3 seconds,

 

An Evolving Story

I’m quite sure that this is not the final chapter, but there does come a point where organizing becomes a major distraction in and of itself, and as a friend once said, “How many frogs do you want to kiss to find an even-more-handsome prince?” 

I look forward to your comments and can only promise to be returning to matters of more immediate substance very soon.

Posted in z Silverlight Archives | Comments Off on Organizational Chaos Followup

Have I Missed The Bus?

About 5-10 times a week I get a letter that says something like this:

“Your book, Complete Idiots’ Guide to a Career in Computer Programming  is wicked old. Do you still believe a programmer can be self-taught and is it possible for someone my age?”

Got one today and thought I’d answer here.

John,

The short answer is that the book is terribly out of date on its specifics (languages, technologies, etc.). There are a lot of new choices to make as to which technology to follow; I have completely hitched my wagon to Microsoft’s .NET since 1999, and as of 2007 I now work for Microsoft as “Silverlight Geek”

With that information (and caveat) let me say unequivocally that the answer to both questions is yes, but it is far harder than most people expect, and the chart I often draw relates to how far people get in their first programming book. It looks like this:

Pctg of pages Read2

I totally made the numbers up, but based on talking with literally hundreds of readers and students. Folks start out with very strong intentions, but then the material gets difficult, their other job and family and real life intrudes and their resolution wavers.

So the first question is this: are you an autodidact? If not, save yourself a lot of grief, and start with a class, or better, a degree program at a good university.

That said, it certainly can be done; I did it (I had no choice, they kept kicking me out of school) and many of the best programmers I know did as well.  Of course, I started teaching myself when there was a lot less to learn.

And that is what I’d suggest you do; learn a lot less than there is to learn; narrow the field. Start by getting opinions from people who seem to love their jobs and who actually code for a living. Note that none of us will be right, but you may be able to eliminate some areas that are clearly wrong. Then pick a narrow field and learn that and nothing else for the first year.

Reasonable focus areas to consider:

  • Silverlight (Rich Internet)
  • WPF (desktop application)
  • ASP.NET / AJAX
  • Flash/ AIR (Rich Internet)
  • Java
  • Database
  • Open Source & Dynamic Languages
  • There are many others

I have had four career altering moments: 

  • Moving from general Unix programming to serious C coding on Unix
  • Switching to C++ / Windows
  • Switching to C# / .NET
  • Focusing on Silverlight

Warning: I now work for Microsoft as the “Silverlight Geek” and thus have a strong bias. But you know that.

A Crash Course

Let’s assume for the moment that you decide, correctly <smile> to learn .NET and focus on Silverlight and C#, learning the associated technologies along the way. Good choice.

iStock_MusicWireManMedium

Here is how I’d suggest you do it. Note that I’ll be recommending my books and others, but there are many alternatives. I’m also assuming money is not an object, but there are often free or nearly free alternatives.

  • Get a good development environment. A PC with at least 2, preferably 4 gig of RAM, a fast and big disk or two, and I strongly prefer two monitors, as big as you can afford.
  • Your development environment. Depending on your timing that will be Visual Studio 2008 or 2010.  Best is to buy the MSDN Subscription but they are expensive (ranging from $1K to 10K). You can of course just start with C# Express which is free.
  • Get a good introduction to the language and to .NET. I recommend Learning C# 3.0 (by me and Brian MacDonald).
  • Follow that with selected chapters from Programming .NET 3.5 by me and Alex Horovitz. (Just by the way, this is my most underappreciated books <smile>). For the first go ‘round, read chapters 1,2,8,10 and then save the book for later (you’ll be back)
  • OK, you’re ready for Silverlight. My guess is that by the time you’re ready we’ll have released Silverlight 3 and the new books on Silverlight 3 will be available as well.
  • I’d get at least two books on Silverlight (but I buy lots of books) and at least one on Expression Blend 3

Everything you need for Silverlight is at our web site. Start with my  Guide to Getting Started. (Note to self: update that page very soon!)

  • Go to our Forums often.
  • Sign up and read some of the better Silverlight blogs. You can find them by subscribing to Silverlight Cream.

Write Code, Publish Code

As soon as you feel you can write a Silverlight application that does something cool, make sure you put it where people will find it.  Then keep going. As soon as possible, get any work you can, paying or not. Contribute code to open source or anything else you can. Build confidence. Write articles on things you’ve just learned.

 

Best of luck!

 

jessesig

Posted in z Silverlight Archives | Comments Off on Have I Missed The Bus?

Where’s Jesse?

From now until sometime this summer, you may notice bursts of slow. Please mark this up to:

  • Summer vacation
  • Building embargoed videos so that we have lots of great stuff ready when Silverlight 3 is released
  • Updating older videos, tutorials, etc.,  so that they work great when Silverlight 3 is ready
  • Planning Silverlight 4 <smile>
  • Vacation (what??)
  • Cooking hard on the VideoWiki project’s new incarnation (more soon)

That said, MiniTutorials and Videos will still be a major effort, and will only ramp up even more once Silverlight 3 is live (which as you know is…. well, soon!)

But stay turned, what I lose in frequency I’ll make up for in incredibly astute and entertaining writing, breaking news, inside information, unauthorized leaks and internal gossip. Or not.

Meanwhile, I’ll be twittering and writing about my adventures and experiments in attempting to take Videos to the next level. Since it isn’t something everyone will be interested in, I’ll move it to a separate on-going story accessible as pages outside the main flow, from a link on the side bar, much like the Quick Bits.  The first entry is here.

Posted in z Silverlight Archives | Comments Off on Where’s Jesse?

And to think that I found it on Bing

Ever since I started writing books I check Google (and for the past number of years it has been Google) for my name every now and then; both for the ego gratification and to see if there is misinformation or unhappy readers or other stories I should respond to.

Bing

Not that long ago, like a good corporate boy I would Live Search (boy that was hard to make into a verb) for my name. Eh.

Today I tried Bing.  In the first page of searching images, I found an interview I gave last year at TechEd Barcelona, but was never able to track down.

TechEdBarcelona

Wow am I glad I’ve shaved off the dopey facial hair.

I was pretty impressed when I clicked on Biography. Somehow Bing culled through my 3MM entries and found 5,100 that were specifically biographical. Cool.  Here’s the first line of 6 of the first 10 articles found,

Bio
The other 4 had to do with me but were not really bios. Still, not bad.

I’ll be keeping an eye on Bing. Meanwhile, get ready to Bing yourself, don’t be shy.

You can find out more on Bing.com

(Yes, this sounded a lot like hype, but I really liked it. And it is nice to see something new in searching)

Posted in z Silverlight Archives | Comments Off on And to think that I found it on Bing

What’s New In Silverlight 3

I had the pleasure of presenting What’s New In Silverlight 3 both at TechEd this year and then again to the Redmond .NET Developer’s Association,

Redmond

I think the best way to make this material available is to post my slides here along with the source code, and then to point to videos and blog entries that cover this material (either existing or as I create it in coming weeks).

Please note that this presentation was given using Silverlight 3 Beta.

  • If you are reading this and we are still in Beta, then you can get what you need by clicking on the image below, but please read the caveats carefully about using the Beta version.

GetStartedSL3

  • If you are reading this after we’ve released the RTW version of Silverlight, be sure either to obtain the updated version of the code or to proceed with caution as there may be small differences from the beta.

The slides are here as a zip file.

The Demos and Supporting Videos

3dFlip

For the first demo, 3d flip,  I recommend reviewing Using 3d Transforms Part 1 and Part 2.

For the second demo “The Slider and the TextBlock” you’ll want to look at the video Element to Element Binding.

The third demo is on Easing, and we have a good video on that here, as well as a mini-tutorial here 

Demos #4 and #5 are on Pixel Shading and bitmaps. Best we can do for you for now is this excellent video on Pixel effects.

The Bounce demo shows how messaging works and is so much fun you won’t need much to go with it.  After that you come to the demo for “based-on” styles.

Based-On Styles

I don’t have an entry for that for you yet, but one is coming very soon. For now, take a look at the following Xaml which is the heart of the demo:

   1: <Style x:Key="StandardButton"

   2:        TargetType="Button">

   3:   <Setter Property="Width"

   4:           Value="100" />

   5:   <Setter Property="Height"

   6:           Value="35" />

   7:   <Setter Property="HorizontalAlignment"

   8:           Value="Left" />

   9:   <Setter Property="VerticalAlignment"

  10:           Value="Bottom" />

  11: </Style>

We start by defining the style for a standard button, setting a width, height and alignments.  This style can be assigned within the Xaml to any button as follows:

   1: <Button x:Name="Button1"

   2:         Content="I am a standard button"

   3:         Style="{StaticResource StandardButton}" />

Now we want to create a Big button. A big button style is just like a standard button, except that it is taller and wider. Its alignment is the same.

   1: <Style x:Key="BigButton"

   2:       BasedOn="{StaticResource StandardButton}"

   3:       TargetType="Button">

   4:    <Setter Property="Width"

   5:          Value="250" />

   6:    <Setter Property="Height"

   7:          Value="50" />

   8: </Style>

You can see that what is key in this definition is the new BasedOn property.  You assign this new style exactly as you would any other style…

   1: <Button x:Name="Button2"

   2:         Content="I'm a big button"

   3:         Style="{StaticResource BigButton}" />

You can base a style on a style that is based on another style. In our final example, we’ll create a BigFont button that builds on the BigButton but sets a larger font.

   1: <Style x:Key="BigFontButton"

   2:     TargetType="Button"

   3:     BasedOn="{StaticResource BigButton}">

   4:    <Setter Property="FontSize"

   5:        Value="24" />

   6: </Style>

In this case, BigFontButton is “inheriting” its width and height from BigButton and its alignment from StandardButton.  When we assign this to Button3…

   1: <Button x:Name="Button3"

   2:         Content="Style: Big Font"

   3:         Style="{StaticResource BigFontButton}" />

The results are just what we hope for:

BasedOnStyles

DataValidation

The DataValidation demo is, if I’m honest, my favorite. I particularly like that this works by combining two existing parts of the Silverlight framework:

  • The ability to have the data object test a value and throw an exception if the value is invalid, which is turned into an error by the binding object and returned to the UI
  • The Visual State Manager which makes responding to that error either trivial or fall within a well established pattern.

Another thing I like about this feature is that you can and will use this long before you have a deep understanding of how it works.  That can be frustrating when you want to modify the behavior, but all the pieces of the puzzle are available, and here’s a road map to getting there.

First, Visual State and Templates

I would approach this by temporarily setting aside the issue of error handling and start with visual states and templates.  We have a series of videos that walk  you through this, and I’d view them in this order:

If you are serious about obtaining a deep understanding of all this, I’d also read the following mini-tutorials

With all that done, error handling will be almost self-evident.  The data entry classes have a new Visual State Group: ValidationStates that consists of three possible states

  • Valid
  • InvalidUnfocused
  • InvalidFocused

The sequence of events is that when the user attempts to enter data into one of the data entry objects (e.g., a TextBox) that data is transmitted to the DataBinding engine which asks the data object to which the TextBox is bound if the data is valid.

In the demo, we create a Book as a data object, and the book has an ISBN field.  We bind a TextBox to the ISBN field and when the user enters the ISBN the DataBinding object asks the book instance if the ISBN is valid.  The Book tests for three conditions:

  1. The data must be 10 characters long or it throws an exception with the exception message “Must be 10 characters long”
  2. The data must consist only of the numerals 0-9 or the letter X or it throws an exception with the exception message “must consist only of the numerals 0-9 or the letter X”
  3. The last character must match the checksum of the first 9 digits (the algorithm is described in Wikipedia) or it throws an exception with the exception message “checksum not valid.”

If you have set your flags properly (to be described in a minitutorial on data validation) the exception is turned into a command on the UI to change the visual state from Valid to either InvalidUnfocused or InvalidFocused.  What happens then is entirely up to whomever created the behavior for those visual states.

Rather than leaving you to your own devices, the controls team has provided default Visual State behavior for the following controls:

  • TextBox
  • CheckBox
  • RadioButton
  • ListBox
  • ComboBox

and in the next (post-beta version) PasswordBox

That behavior is to turn the control red, and when you click back in, to display the message from the exception,

InvalidChecksum

 

You are of course free to change all of this by templating this control just as you would any other (which is why you invested all that time reading about templating!)

Navigation

The final demo doesn’t exist. I just open up Visual Studio and create a new project clicking on Silverlight Navigation Application as shown in this cropped image,

NewNavProject

Visual Studio creates the infrastructure for you, opening with four Xaml files: MainPage.xaml and in the Views folder, AboutPage.xaml, ErrorWindow.xaml and HomePage.xaml.  Running the application (without touching it in any way) gives you a multi-page application ready to be customized to your needs.

NavigationWindow

More details to come on Navigation and especially on Validation. 

Posted in z Silverlight Archives | Comments Off on What’s New In Silverlight 3

On The Bleeding Edge: Where All The Fun Is.

Tim Heuer did a brilliant job in his recent blog post sorting
through and summing up some of the confusion that has
arisen out of the current unusual circumstances of Silverlight,
Blend and Visual Studio all having two versions available at the same time: a release version and a pre-release version.

Rather than replicating his work, let me point you to his
post and also provide a slightly different perspective of life on the bleeding edge… 

 

Silverlight, Blend, Visual Studio, Oh My.

SilverlightLogo Silverlight 2 is a released development product available here 

Silverlight 3 is a beta product (with no commercial go live license) that is scheduled to go live this summer. It is available here.

Expression Blend 2 is the current commercial version of Expression Blend, available with full support (and on a trial basis if you like) here.  This supports Silverlight 2.

Blend 3 is in Preview mode and targets Silverlight 3, it is available on a trial basis here. To target Silverlight 2 you will want Blend 2 SP1.

VS2010 Visual Studio 2008 SP1 is the current and fully supported edition and it comes in many flavors: Standard, Professional, and Team System

Visual Studio 2010 Beta is ready for testing.

Windows Windows Vista is our current released operating system for individual computers, available here

Windows 7 Release Candidate is here and available for you to test

The Bottom Line

There are numerous mix and match variations, but why make yourself crazy? 

  • To target Silverlight 2, install Silverlight 2, Blend 2 and either VS 2008

  • To Target Silverlight 3:
    • Install Silverlight 3, Blend 3 and VS 2008 (Sp1) or
    • Install Silverlight 3, Blend 3 and VS 2010

NB: If you choose Visual Studio 2010 you will not be able to use the RIA Services at this time.

You can choose other combinations (e.g., Silverlight 2, Blend 2 and VS 2010, but unless you have good reason to, I don’t see the point. If you want the exhaustive list, however, see Tim’s post.

Please note that any time you are installing a Beta product you are on the bleeding edge and you must be prepared for less reliability than with a released product. Further, it is my personal belief that if you install a pre-release product you must also be prepared to repave your machine when you install the next version. It may not be needed, but being ready for it is a prudent precaution.

Pioneers take Risks But Achieve Great Things

Using pre-release software can certainly create headaches: when you run into a problem you must ask yourself: Is it Blend?  Visual Studio? Win7? Silverlight or me?   Aiiii!   But it is also the very best way to keep ahead of the learning curve, and each of these products, though pre-release is surprisingly stabile and each is well supported on their respective Microsoft sites:

My Working Environment on the Bleeding Edge

As a personal choice, I am currently keeping these working environments: 

Silverlight 2, Blend 2, Visual Studio 2008, Vista.

Silverlight 3, Blend 3, Visual Studio 2008, Windows 7.

Silverlight 3, Blend 3, Visual Studio 2010, Windows 7.

I do most of my work on the last of these, and so far it has been a gas.

Virtual Machines

As Tim correctly points out, one very powerful option when working with pre-release software is to use virtual machines – easily reset and recreated, but typically you pay a bit of a performance penalty.

Posted in z Silverlight Archives | Comments Off on On The Bleeding Edge: Where All The Fun Is.

I’m committed to Two Tool Development

I confess. After years of developing with separate debuggers, editors and compilers it was a wondrous thing to have an Integrated development environment in which all three and more were combined. I love Visual Studio.  And for the past year or so I imagined that Blend, while wonderful, was a temporary solution until Dev10 (shorthand for Visual Studio 2010) was ready.

Bzzzz. No! But thanks for playing!

After reviewing Dev10 (which is wonderful) and talking with the team, I’m now convinced that while many developers will do all their development in Visual Studio, serious (and certainly advanced) Silverlight programmers will in fact opt to work with two tools indefinitely.  It isn’t just that Blend is better suite for some types of work and VS for others; it is that there are real limitations (did I say that?); places where they do not overlap, and won’t any time soon.

For example, and taking this from the perspective of a developer; I’m thrilled that I can now create rows and columns in my grid in VS and that I can drag and drop controls on the design surface. That greatly simplifies the design process and while Blend may have some advantage there, only time will tell whether it is worth switching back and forth to accomplish these goals.

On the other hand, if I want to add animation I have two realistic choices: hand code it in Xaml in Visual Studio (always fun, might be dangerous, maybe tomorrow) or open Blend (where it just keeps getting easier).

Similarly, if I want to template a control (which, interestingly, I want to do more and more, especially as I work more with Data Validation), then once more Blend is not only the tool of choice, it is my only viable alternative: Visual Studio just isn’t designed to make that easy.

Coding In Blend

“Well,” I hear you say, “why go to VS at all? You can code right in Blend, with Intellisense and etc.”  Yah, you can. But as my buddy Dave Platt says (I’m cleaning this up) you can have an appendectomy through your mouth; it just takes longer and hurts more.  The ability to do bits of coding in Blend is a great convenience, but it wasn’t designed to be a programmer’s environment and there is no comparison between the level of support if offers and the level of support offered in Visual Studio. Not even close.  (OK, I owe you a list of specifics, but for now let’s take it as given).

That’s Not A Bug It’s A Feature

It is tempting to be somewhat defensive about this; almost as if this were a step backwards. But on reflection, I think it is actually a great leap forwards.  Rather than trying to make VS into an almost adequate designer, the folks who own Visual Studio decided to create a great developer tool. When you need to go beyond that, to take on relatively advanced design problems (such as managing view state and the associated story boards) it makes sense to use a tool that does that for a living.

And since the two tools work on the same project at the same time, with no need to “import” or “export” cycling between them is (nearly) painless.

Caveat: You Can’t Get There From Here (Yet)

While I strongly encourage you to create a machine with VS2010 (on Win7 if you can!) and with Blend 3, please note that as of this writing you can not open a Silverlight 3 project written for .NET 4 with the Blend 3 currently available (remember, we released Blend 3 back in March, years ago in web time).  To overcome this horrific limitation <smile>, you need only create a .NET 3.5 application. To do so, create a new solution, click on C# (or VB or Silverlight) and then drop down the framework and select ..Net Framework 3.5 as shown here,

Framework35

You’re back in business, though you will not for now be able to take advantage of the new .NET 4.0 framework features.

I will be returning to this theme of two-tools quite a bit, but wanted to open the door for discussion right away as I explore the myriad features in Silverlight 3.

Posted in z Silverlight Archives | Comments Off on I’m committed to Two Tool Development

Just Built My First SL3 / Dev 10 App

As you no doubt know we released Beta 1 of Visual Studio 2010 today   (the usual caution applies: I would advise only installing this on a machine you are prepared to repave!).  [Update – the Landing Page for all things related to VS 2010 Beta1 is here. ]

I installed it and Silverlight 3 on my laptop running Windows 7 (yowza!) and then fired it up and created an incredibly simple app as follows:

NewVS10Project

In the new project dialog shown cropped here, I chose to build to the latest version of the .NET Framework (marked Red-circle 1), then chose C# as the language I’d build in (2); narrowed the types of projects by choosing Silverlight (3) and finally chose a Silverlight application (4). 

At the bottom (not shown) I picked the directory and named the project Element Binding.

NewVS10ProjectDialog

 

 

As in previous versions, I’m prompted to choose either a web-based or a simple test application (I chose the latter) but I then had to choose to build to Silverlight 3 rather than 2).

VS10WhichVersion

Visual Studio opens on a new Silverlight 3 application and here is where everything changes.  No longer does the design surface say preview; now it says “Design” and means every syllable.  I created columns and rows much as I would in Blend (by clicking in the margins of the grid:

VS10CreatingColumns

I then dragged a slider into the first column and a text block into the second. WooHoo!

VS10DragControls

I then set the values for the slider to be 0 to 100 and the small increment to be 1 and the large increment to be 100. Finally, I set the properties for the TextBlock, the most important of which being its Text; which I set by clicking on the symbol next to Text (shown circled below) to choose Apply DataBinding

VS10ApplyDataBinding

The Source Dialog opens, and choosing ElementName brings up a list of the elements to which you can bind. Clicking on Slider1 (the slider control) caused the instruction “Use the Path pane to choose propoerties for the Source“ to appear as shown circled in the figure below,

VS10BindingToAnElement

Clicking on the Path pane opened a list of all of Slider’s properties. The property I wanted to bind to was Value, and I clicked on that. I had the option of choosing additional properties or options, but that was all I needed and in fact when I closed the dialog the value of the slider was immediately reflected in the text block in the designer. A quick test run of the application demonstrated that the TextBlock was now bound to the value of the slider, with no need for an event or an intervening data object! 

Sweet.

The application runs as intended,

VS10BoundElement

and here is the complete source, all of which is Xaml:

   1: <UserControl x:Class="ElementBinding.Page"

   2:    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   3:    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   4:    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

   5:    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

   6:    mc:Ignorable="d"

   7:    d:DesignHeight="100"

   8:    d:DesignWidth="200">

   9:    <Grid x:Name="LayoutRoot"

  10:          Background="White"

  11:          Height="62">

  12:       <Grid.RowDefinitions>

  13:          <RowDefinition Height="3*" />

  14:          <RowDefinition Height="1*" />

  15:       </Grid.RowDefinitions>

  16:       <Grid.ColumnDefinitions>

  17:          <ColumnDefinition Width="200*" />

  18:          <ColumnDefinition Width="200*" />

  19:       </Grid.ColumnDefinitions>

  20:       <Slider Height="22"

  21:               Margin="0,20,0,0"

  22:               Name="slider1"

  23:               VerticalAlignment="Top"

  24:               Maximum="100"

  25:               SmallChange="1"

  26:               Value="50"

  27:               LargeChange="10" />

  28:       <TextBlock Grid.Column="1"

  29:                  Height="21"

  30:                  HorizontalAlignment="Left"

  31:                  Margin="5,0,0,0"

  32:                  Name="textBlock1"

  33:                  Text="{Binding ElementName=slider1, Path=Value}"

  34:                  VerticalAlignment="Center"

  35:                  Width="95"

  36:                  FontFamily="Verdana"

  37:                  FontSize="18" />

  38:    </Grid>

  39: </UserControl>

 

The key new Silverlight 3 feature is found on line 53 where we bind directly to the Slider.

This is just too much fun.

ecq100

Example-Code Quality, Guaranteed!  This code was compiled with Silverlight 3 (Beta) using Visual Studio 10 (Beta) on Windows 7 (RC).  For more on this guarantee, please see this page.

Posted in z Silverlight Archives | Comments Off on Just Built My First SL3 / Dev 10 App

Time Flys Like An Arrow; Fruit Flies Like A Banana

We recently released my video on the new Animation Transition Control and in looking it over I noticed that I promised to follow up on the definition of a Date/Time “Tick”

Gregorian

A quick look at Wikipedia reveals any number of problems with attempting to count the number of nanoseconds from the date 1/1/01. Without diving too deep into this bit of trivia, I will note that the Gregorian calendar used in civil affairs (in which today is May 8, 2009 AD or CE) attempted to fix errors in the Julian calendar but missed the mark, and created problems of its own.  These were “corrected” a number of times, introducing new problems making it nearly impossible to historically find your way backwards with any exactitude through the middle ages (10 days were dropped from the calendar all in one go in some countries by Papal Bull, but not in other countries, and some parts of Europe did not adopt some aspects of the Gregorian calendar for another two hundred years, with the Swedish introducing February 30 (30!) in 1712). Greece didn’t make the switch until 1918, fully three centuries after Pope Gregory’s proclamation.

Complicating things further is the introduction of leap seconds for the past 40 years, to account for the accumulation of irregularities in the Earth’s rotation.

Rata Die

A little further research, however, puts this all to rest, as it turns out that the Rata Die (RD) system assigns numbers to calendar days independent of calendars, and is almost certainly what Microsoft uses for Ticks as RD counts forward from 1 at midnight on January 1, year 1  in the Proleptic Gregorain calendar (that is, the Gregorian calendar you produce by starting today and carrying the Gregorian calendar backwards in time past the years of its introduction). 

Wasn’t that fun?

Posted in z Silverlight Archives | Comments Off on Time Flys Like An Arrow; Fruit Flies Like A Banana