I love my work but it is a good thing I have a family

They went away this week (visiting my in-laws) and I stayed home to catch up on videos, tutorials and etc.  I’m not quite sure I realized how much time I was spending in front of the computer – nor how easy it is to eat up time getting things quite right, but here is my log for July 3

DayLogJuly3

oops.

Never leave a geek home alone

I just looked at the garbage; not a good sign. The guy from Dominos knows me by first name and I don’t like their pizza.

PizzaPosterboard

I sure hope their flight is not delayed, I can’t keep this up for much longer.

 

photo info: Dash camera, Photoshop, mild posterboard. Original photo: Jesse Liberty July 5, 2008 No rights reserved.

Posted in z Silverlight Archives | Comments Off on I love my work but it is a good thing I have a family

Camtasia Crash Tip

[Updated 7/3]

If you are using Camtasia (wonderful product) to create your screen captures and you do a lot of editing (especially zooms and call outs and cuts) you run the risk of overloading the project and causing Camtasia to slow and/or crash.

To avoid this, periodically grab a segment of your project and turn it into an AVI, cut that segment out and replace with the avi; then all the changes collapse into one as far as the project is concerned.

Update follows…

Pitfall #1: if your project is complex enough, you'll find that when you mark a selection and tell it to produce an AVI it does not capture the entire selection! And, worse, it doesn't tell you. So be sure to check that you (a) back up the project before making the avi and (b) check the avi.  If this does happen the work around is to mark the selection, then choose "Crop to selection" (very scary!) which deletes the rest of your timeline. Then produce your avi. Then restore (ctrl-Z to undo) the cropping. Now you can delete the selection and replace with your avi.  Sounds more complicated than it is, but make sure you are backing up and giving good names to your template files.  I now have a directory structure that looks like this for each project

 CamtasiaFolders

 

Pitfall #2: while you can edit the avi's you produce, each generation (each time you produce a video) creates some degradation in quality. Specifically if you make an AVI out of a camrec, and then edit that avi and make a 2nd generation avi which you then edit, and then make an avi out of the edited avi, pretty soon the sound quality is noticeably degraded.

 

-j

Posted in z Silverlight Archives | Comments Off on Camtasia Crash Tip

Zen Presentation

Another in a series of ruminations about how to Present Silverlight.

One of the brighter Silverlight coders and MVPs asked me tonight “what is all this about your changing how you present at conferences and web casts.” 

In answering him, I realized that my thinking continues to evolve, and that it might make a somewhat interesting post, so here it is[1]

What I have in mind begins with refocusing on Silverlight capabilities and the application of those capabilities rather than the syntactic specifics. We do a great job drilling down in our  videos and the tutorials,  and I don’t believe that is why people come to our presentations or Webcasts.

To create a 45 or 60 minute presentation that grabs a programmer and lights up the imagination, I believe you need to start with some form of limiting discipline. The one that works for me is to grind down my idea until I can state it clearly in a single simple sentence. 

The harder task is to then keep that single idea driving every aspect of the presentation.

What you value is what you’ll deliver

Dancer

—
[1]  Almost none of this is  original and my thinking on this was most recently and positively influenced by two great presenters: Garr Reynolds and Scott Hanselman)

Posted in z Silverlight Archives | Comments Off on Zen Presentation

Community Credit – Cool Idea, Cool Site.

 

communityCredit

David Silverlight (isn’t that the second best name you’ve ever heard?) runs Community Credit whose slogan is “We give stupid prizes to smart people.” 

Points5The idea is to recognize and reward folks for participating in the geek community, and he has a fairly sophisticated point system  To give you a sense of how many things you can do to get points, I took a picture of the list, and shrunk it down to 5% (that’s it on the left!). Click on it to see the entire list.

I would of course blow this off as the self-indulgent relentless pursuit of recognition, were I not a two time winner.

 
Given that, I think it is a great and wonderful service, that encourages participation from every aspect of the geek community.

 

 USBWithArnold

Plus, I got this really cool (sorry)  USB desk-top  refrigerator that I can keep my Arnold Palmers cold in. 

I never in my life even heard of an Arnold Palmer (ice tea and lemon-aide) until I went to dinner with Tim Heuer who knows more about Silverlight and about libations than anyone else. I am now hopelessly addicted.

In any case, the refrigerator has blue LEDs so it should be great.

 

[Arnold Palmer was the Tiger Woods of my youth, only for some reason all his games were played in black and white.]

Having said all that, be sure to go check out the Silverlight.net Community Recognition Program which is also wicked cool, but in which I’m not winning any prizes so I don’t like it as much.

 

 


Posted in z Silverlight Archives | Comments Off on Community Credit – Cool Idea, Cool Site.

Progressive Metal – And, oh yeah, Silverlight

Do you have fits of interest?

I go through bursts of reading fiction and I’ll find myself reading everything I can get by suddenly favorite authors (lately it has been Ian McEwan, and  Cormac McCarthy)

From time to time I discover a genre of music that has been there a long time but I just wasn’t hip to it. In the 1990s it was jazz and then blues. That lasted a good long while and took me a long time to work my way through and figure out what I liked (as my friend who has been supporting himself as an artist for 50 years says “I don’t know what I like, but that’s art!”). 

Starting about a year ago I discovered whatever the generic is for Alternative Rock and Metal, and lately that has focused more on Progressive Metal. I started out with Red Hot Chili Peppers, all of Nine Inch Nails, Nirvana, Foo Fighters, took a big excursion into Smashing Pumpkins, all of Rage Against the Machine, and then spent a lot of time re-discovering Zep. Oh my.

Zep

But that is not what I’m writing about.

If I’m going to write about something that appears to have  nothing to do with Silverlight when I should be busy recording a video, I’m going to write about how my metalMania (which also includes a hopeless devotion to Black Sabbath) has suddenly morphed into a powerful interest in Progressive Metal.

 

 

 

Prog Metal

This is not your mama’s rock and roll. So far, and I’ve only just begun, the most interesting music I’ve heard has come from Pain of Salvation and Symphony X 

RemedyLane_     MythologySuite

but what is best about this is I’ve only scratched the surface; there is so much more to find out.

Oh yes, Silverlight

The norm in a blog like this is to lay out a project and then show you the code. Instead, I’m going to lay out a project, and then…. well I’ll write the code,  but not yet.

I’m describing it now, though, because I’m listening to Remedy Lane by Pain of Salvation and the idea and the music are too good together not to write down, and writing it down will commit me to doing it and hey! it’s Sunday and this is more productive than laying on the couch reading the Book Review section of the Times (especially given that my Kindle has three pages of books already).  

So here’s the idea:

Start with the button I’ve written already,

SilverlightButtons

but square it up to the right proportions to show an “album” cover.

  • Get the cover image from a web service (Amazon?) and line up the albums you like or recommend.
  • Mouse over behavior includes
    • swells the album to see a  significantly larger, more detailed image,
    • brings up additional information about the album (artist? price? format?)
    • adds a prominent musical note to the image (in the corner?)
  • Click on the note to fetch and listen to a short sample
  • Click on the button to go to the album’s page

Now you have a Templated Silverlight user control that is much more dynamic (its contents come from a web service based on a list of identifiers held in an XML file) that can be used to generate revenue on your blog, and that is wicked cool.

There, I brought this posting in for a safe landing after all.  Now all I have to do is go record my videos and then build the control I just described and incorporate it into…. well probably into all sorts of things.

Hope you are having a good Sunday.

Posted in z Silverlight Archives | Tagged , | Comments Off on Progressive Metal – And, oh yeah, Silverlight

Rethinking Introductory Material

Wow it is hard to respond to a community that you can’t see or poll and that is shifting by the day. Take this question, just for a moment: at what level should we be targeting our web-cast presentations?

  • They should be relatively advanced; after all if you’ve found your way here, at this stage of beta, you are clearly an early adopter
  • They should be relatively introductory; all our material is coming out fast and furious; and we need more on-ramps
  • They should be intermediate; meeting the needs of both groups

The above can be said about the tutorials once we have a dozen or so, about the videos, and so forth.  What is more, whatever answer you come up with will change (and quickly) as more people discover and choose to learn to program in Silverlight. While we do provide introductory material, there are two problems

iStock_headwithgears1. The intro. material quickly becomes out of date as we learn more and so must be continually refreshed.

2. Much more important, as we add more advanced material, the learning curve becomes steeper and more daunting  We can flatten that curve by rewriting. but this requires an enormous leap of imagination about what we mean by introductory.

The idea of making once intermediate material, introductory is certainly counter-intuitive;  yet we’ve all lived through it. What we were taught in high-school math and science is now taught in sixth grade. The more we know, the more we can comfortably push more down into the introduction.

Presenting It All

This ties in nicely with my earlier post on presentations – I’m coming to believe that everything about how we present new programming approaches must change, at least a bit.  Too strong. I'm coming to believe that I want to change the way I present this material. 

This includes the use of slideware to support emotions and reinforce ideas; the way I demonstrate code, and ensuring that I focus on  “what can be done and why it is  important” rather than “here is how you do it”  when presenting live, and using videos and tutorials/books for drilling into the techniques.

Committing to Dynamic Evolving Multi-Dimensional Info

All of which is to say that if we’re going to do this right we’ll need the following elements, most of which are in place:

  • multiple knowledgeable voices
  • the willingness to cycle back and rebuild earlier material, especially the “on-ramps” – the getting started material

GettingStartedTH

  • redundancy both in different media (live/ videos/ tutorials/ articles/ books/ podcasts) but also in terms of more than one person covering the bigger subjects
  • re-targeting (don’t even try to figure out who your audience is; you have multiple audiences and the level of experience is changing faster than you compile the results of your surveys

One truism that is honored most in the breach is that every presentation (and for that matter every video and tutorial) must be described accurately. That comes into immediate conflict with the need to schedule web casts weeks or months in advance. My solution will be to use my blog to update the exact level and topics 2-4 weeks before each Webcast; and to put that fact into the blurb about the web cast as soon as I can get access to the tool that controls the web cast event.

As an aside, the TSA could learn a great deal about security from the folks who guard that tool.

New Media – Hypervideo

Within the next six months, preferably much sooner, I will be starting a new project: using hyper-video for some of my “How Do I” series. The goal will be to either create or standardize on a  Silverlight player that will indicate when additional information is available. I’ll then be able to present a relatively advanced presentation, with hyper-video links to more introductory material that you can click on as needed. Some of the clicks will bring up other videos, some just text explanations of terms, some links that you may choose to follow or not. More on this to come.

Tag: What To Expect

You’ll find that I’m a big believer in transparency – I think that in my particular role, which we’ve taken to calling “Developer Community Liaison”  I believe in erring on the side of telling you too much about the process rather than too little. The vulnerability is that things change and one might want to say “just get on with it.” 

In any case, not everyone cares. The solution is tagging. All messages like this will be tagged “What To Expect” – feel free to screen to find or avoid as you like. These are process messages, and I won’t mix process with substance (that is, I won’t sneak in any information about Silverlight coding under messages with this tag).

If you have suggestions or ideas, please be sure to send them my way.

Thanks.

photo-credit: headwithgears licensed from istockphoto

Posted in z Silverlight Archives | Comments Off on Rethinking Introductory Material

Want To Follow Silverlight MicroBlog?

SilverlightShow is featuring a brilliant Twitter tool written by Emil Stoychev that you can download here – you can grab the HTML or you can download the source.

If you just get the HTML and plop it into your blog you are free to tell it whom you want to follow (e.g., SLMicroblog. Here’s the HTML:

<div style="width: 250px; height: 310px;">
<object data="data:application/x-silverlight," 
type="application/x-silverlight-2-b2" width="100%" height="100%"> <param name="source"
value="http://www.silverlightshow.net/twitter/ClientBin/Silvester.xap"/> <param name="onerror" value="onSilverlightError" /> <param name="background" value="white" /> <param name="initParams" value="twitterUser=SLMicroBlog" /> <a href=http://go.microsoft.com/fwlink/?LinkID=115261
style="text-decoration: none;"> <img src=http://go.microsoft.com/fwlink/?LinkId=108181
alt="Get Microsoft Silverlight" style="border-style: none"/> </a> </object> </div>



Suddenly, all the SLMicroblog you can eat…

TwitterBetter

No muss, no fuss. Works great. 


Reposted due to technical problems with the server


Posted in z Silverlight Archives | Comments Off on Want To Follow Silverlight MicroBlog?

Fan Mail

When you work in public, and you invite people to tell you what they think, they will. It often isn’t pretty, but you better listen up.

My previous posting elicited an email (name withheld since it was an email and not a public comment) quoted here in full

You're joking, I trust? You've been doing nothing but apologizing for crappy work since we began working with Silverlight last summer. Your job is important to the success of Silverlight. You need to be replaced with someone who's willing to spend the time required to produce quality work. NO MORE LAME EXCUSES.

 

Clearly this is one frustrated and unhappy customer.

iStock_SadGirlSmall

The key question is why?

What cultural or interpersonal differences in the way that I look at things would cause her to think that I’ve been apologizing for 11 months? (Setting aside the question of whether I’ve been doing “crappy work? ”)

Please do not reply with how much you disagree with her… your kind words are much appreciated, but have been expressed elsewhere. The last thing I want to do is start a debate about her opinion.

The point of this blog post is not about the quality of my work, it is about how to explore new ways of doing things without confusing people or making them angry

Experimenting In Public

I love my job. One of the things I love about it, is that it is not static. In my experience, there are two kinds of people in the world (one kind thinks there are two kinds of people in the world, the other kind doesn’t). 

One kind likes to get really god at what they do and keep doing it. The other kind, like me, likes to keep changing and evolving and trying new things. We love a blank sheet of paper; we are inspired by reinvention.

The post this woman was responding to was about taking the risk of setting aside 15 years of relatively successful presentations and trying a new approach, one that I think will better serve the Silverlight developer, one that is far  riskier, far more work, far less certain and far more exciting. Most important, an approach that is not guaranteed to work but if it does, I believe it will make me a much more interesting presenter with much more to offer.

That is the proposition.

Terror does not create innovation

terroe_eye_1There is a culture in some parts of Microsoft; perhaps some parts of the entire industry,  in which you must never show fear,  never show any weakness, never show anything but total confidence.

I remember this at Ziff/AT&T  we would have meetings and the junior staff was terrified of asking questions for fear of ridicule or at least disdain.

I had the privilege that went with the absurd title of “Distinguished Software  Engineer” of asking the “stupid” questions that many others (it turned out) wanted answered as well. It taught me a powerful lesson; don’t be afraid to look stupid; it is a lot better than being  stupid.

Somehow this connects up with an article I read recently that profiled 10 billionaire entrepreneurs who had, among them, 25 previous bankruptcies.

Fall Down, Get Up

So, despite advice, I continue to experiment, and I continue to do so openly; shockingly acknowledging when things don’t go as planned, working harder and preparing more the next time, and building up a stronger base of tools with which to convey what I think is some of the most interesting and exciting information for developers: the what and why and how of Silverlight 2 as it evolves. 

Why You Never Score A 10

I’ll leave you with this oft-told story. Early in my writing, back when I was writing about C++,  I received two emails on the same day. One said in essence “no one has ever explained pointers in a way I understood before.”  The other said “I don’t know what it is you do for a living, but it can’t be programming or writing because you are terrible at both.” I hug them both on my wall, and perhaps I will hang this feedback next to them.

My actual favorite email said this: Please sir, I translate your book to Korean, but first, what means ‘I don’t think we’re in Kansas anymore?”

Keep those cards and letters coming, and if you are unhappy let me know, but please try to be specific. What is bad, what needs fixing specifically. I can’t promise that I’ll agree, but at least I’ll know where the trouble is. If you are happy, let me know that too (I pass those to my boss!); as my friend Laurence Moroney says “all proceeds go to a college fund – my kid’s college.”

And worry not; my ego (and my job) are secure. Or secure enough.

Thank you. We now return to our regular blog, already in progress.

 

 

Picture of girl: iStockPhoto
Picture of eye:  stock.xchng
All pictures fully licensed by Jesse Liberty

 


Posted in z Silverlight Archives | Comments Off on Fan Mail

One Man’s Guide To Silverlight Nirvana

 

 

Every day (honest) I am asked for a path through the learning material, even though the Getting Started page offers an explicit path. And that is not surprising. We all have our own way of learning. Here is the path that I personally tend to suggest to most Silverlight neophytes.

Path of quick learning: 

Go to Getting started and get all the links shown here

clip_image002

Then watch the video on the same page on getting started.

clip_image004

Once Set UP, Writing Programs

Read this tutorial on interface controls.

Watch [forthcoming] this video on why I made the switch to coding with Silverlight and Blend and how powerfully they work together, and then watch watch these “How Do I” videos on Blend for Programmers:  Part 1 Part2 Part3  and/or read this tutorial 

Data

Next, it’s time to focus on this video on data and then this tutorial on creating n-tier applications CrossDomainand data binding.

Follow that with a great video on  Cross Domain issues and then read up on user controls which you can supplement with this video on keyboard input followed by this video on user controls.

Styles and Templates

You may  then want to read my tutorial and watch my videos on Styles and Templates (to be posted in the next week or two) or check out Karen Corby’s excellent 4 part series on the subject.

Freestyle

After all that you can pretty much move freely among the other tutorials and videos.

Best of luck


Posted in z Silverlight Archives | Comments Off on One Man’s Guide To Silverlight Nirvana

Presentations 2.0

 

Today I had the pleasure (and technical glitch frustration) of delivering the first in a new series of webcasts. 

I’m trying a number of new things in response to changes I’ve observed in the last few years,

1. I think the days of “here’s how you accomplish this” presentations are drawing to a close.”  We’re providing much more of that through our “How Do I” videos and tutorials, and the documentation is getting much better, the community support is getting much better, and there is a huge library of books that come out much earlier in the life-cycle.

2. The Internet has changed presenting just as it has changed many other things, and in this case, mostly  for the better. Standards are higher, and both sides of the many to many relationship have grown enormously. 

3. The material is more complex and there is a much larger pool of potentially interesting material. The  need for “how” is being dwarfed by the need for “why” and “what is most important”

4. People are finally fed up with Death By Powerpoint.

So, I found myself doing webcasts (and to some degree presentations) that were really un-edited How Do I videos and that was not a good thing. Live TV has its amusing moments, but not when you’re the guy who just lost his place in the script when the klieg lights went out.

Sitting on the beach reading PresentationZen I became reinvigorated by the possibilities, and turned my ideas about presenting,  inside-out in a rush of euphoria. iStock_Leaping against blue sky Large

 

The idea would be to start fresh; to marry three ideas at once:

*  Better, More Interesting, Presentations that Tell A Story, with a focus on what and why rather than how

  • * Present them to a virtual audience through web
  • casts and perfect and hone them for live presentation as my understanding evolves alongside Silverlight

* A series of Presentations on Programming Silverlight with Blend and Visual Studio

 

 

Well… it is a work in progress.

I spent a few days working on my first presentation, but after all, this is material I know cold. Then yesterday, I really got down to the business of creating the presentation and practicing and timing it.

Hours

 

But, it was worth it. Because I practiced, when it was time to do the presentation, my software failed, the audio failed, PowerPoint failed, I couldn’t log in, one of the videos that I had tried twice successfully wouldn’t run and the images that I carefully crafted looked terrible because I forgot to adjust the color settings.

If you want something good, you just have to put in the time.

  

  

  

Rome Wasn’t Built in a Day

Rome

I am not complaining. There are not too many other jobs where one gets a chance to work, learn, contribute, grow, fail, improve, and get paid for it, all while playing with cutting edge technology and talking to some of the smartest people around.

I’m having a blast. I hope you are, and if you’re not, send me email and let me know why (if you are, tell someone!)

Parting Words

What I like best about this is that it may not work. I’m doing this without a net. You know, like life.

 

 

Picture of leaping boy: iStockPhoto
Picture of building:  stock.xchng
All pictures fully licensed by Jesse Liberty


Posted in z Silverlight Archives | Comments Off on Presentations 2.0

Look Ma’ No Code

SilverlightButtons 

 

I have been trying to consolidate.  Most of my work is here, in this blog, and for this site, but I also have a Blog for O’Reilly and a political Blog, and a page where I list the books I’ve written, and a support site and… 

JesseLiberty About a year ago, I migrated away from my business web site and set up a “portal” to all my on-line “presences.” which, frankly, I slapped together.  It is ugly, but its concept is to show an image that is a link to  each site or blog.  

Since I’m about to tape a series of videos on Templates and the Visual State Manager to coincide with releasing a tutorial on the subject, I thought I’d “play” with the idea of replacing the static images with buttons. Each image could be hovered over and would grow (and identify itself), could be clicked on, etc.

It turned out to be a pretty easy exercise (like many things, a couple hours to figure out, but the next time will take 5 minutes) and will both make a good exercise for the videos and will make my site nicer (once I get around to (a) perfecting the buttons and then (b) switching the rest of the images over!)

For now, you are welcome to take a look, (if you do, be sure to hover over a button, and even more fun, click in the control but not on a button and then hit tab, changing focus).

Just Xaml

The point of this blog post, however, is that a buddy (who is a killer javascript programmer and the best high school math teacher on the planet) wrote to me and asked “how did you make them spin” and in explaining (briefly) i realized that it might be interesting and surprising that there was no non-declarative code; everything was done in Xaml. 

What I’m about to write will make a lot more sense after you read the tutorial and see the videos but I’m going to capture it today as I have it in my head, so forgive me for putting the cart of details before the horse of introduction.

Image rotation, and everything else (making it larger, etc.) is just a transition based on the “state” (mouse over, etc.) . There isn’t one line of code in there; it is all declarative Xaml.

<vsm:VisualState x:Name="Focused">
    <Storyboard>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000"         
           Storyboard.TargetName="thePanel"     
            Storyboard.TargetProperty=
              "(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="360"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</vsm:VisualState>

This is an excerpt of the Visual state group that shows the Visual state for when the panel has the focus.

A storyboard is an animation. Here we’re using a DoubleAnimationUsingkeyFrames which is to say we’re going to go from one discrete state to another (keyframe animation) by changing the value of a double (the angle). The name of the target is “thePanel” which is a stackpanel and the TargetProperty is held in a collection, but is the angle of rotation (all this is built using a tool).

The actual set of keyframes can be many for making a nice animation, but I just spin it so I only need one; at time zero I set the value to 360. Since my duration is set to a fraction of a section, it spins fast.

Here’s the Xaml for when the mouse moves over the button…

<vsm:VisualState x:Name="MouseOver">
    <Storyboard>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="thePanel" 
                                     Storyboard.TargetProperty=
                                     "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.75"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                     Storyboard.TargetName="thePanel" Storyboard.TargetProperty=
                                     "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.75"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="TagText" 
                                             Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0.4"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.8000000" Value="0.6"/>
            <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.8"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</vsm:VisualState>

This time, when the mouse is passed over, the story board does a few things. First, it scales up on the x and y by 1.75 over a short period (not instant cause it looks goofy). It then also tells the TextBlock (which dynamically loads the name of the button from the tag value) to change its opacity from 0 through 0.2, 0.4, 0.6 to 0.8 at the time intervals shown (0.3 seconds, 0.5 seconds 0.8 seconds 1 second, respectively), thus the name fades in to 80% opacity.

The three buttons are all one template button used three times, the declaration of each is in the page. Here’s the declaration of the first:

<Button  x:Name="blogButton"
    VerticalAlignment="Center" 
    HorizontalAlignment="Center" 
    Template="{StaticResource PortalButton}" 
    Grid.Row="1" 
Tag="My Blog"> <Button.Content> <Image x:Name="BlogImage" Source="SilverlightBlog.jpg" Width="Auto" Height="Auto" /> </Button.Content> </Button>

The Template statement takes a normal button and tells it to use my custom template

The Tag attribute is used by the template to set the text in the TextBlock that fades in when you hover over the control

The Button.Content attribute fills the templated button  with whatever you put in it, in this case the image. This is put in the page rather than the template so that each instance can have its own image.

A second button would look the same but have a different tag and different image, and of course would sit in a different placement in its page.

<Button x:Name="SilverlightButton"
   VerticalAlignment="Center"        
   HorizontalAlignment="Center"     
   Template="{StaticResource PortalButton}" 
   Grid.Row="1"  
   Tag="Silverlight.Net">
   <Button.Content>
       <Image x:Name="SilverlightImage" Source="SilverlightNet.jpg" 
Width="Auto" Height="Auto" /> </Button.Content> </Button>

 

Event Handlers

I lied about there being zero code ( I told you not to believe anything I say!) .  When you click the buttons there is an event handler on the click event in the page that holds the buttons,

void button_handler( object sender, RoutedEventArgs e )
{
    HtmlWindow win = HtmlPage.Window;
   string url = string.Empty;

   Button pb = e.Source as Button;
   if ( pb != null )
   {
      switch (pb.Name.ToString().ToUpper())
      {
         case "SILVERLIGHTBUTTON":
            url = "http://silverlight.net";
            break;
         case "BLOGBUTTON":
            url = "http://silverlight.net/blogs/jesseliberty";
            break;
         case "MICROBLOGBUTTON":
            url="http://www.twitter.com/SLMicroBlog";
            break;
      }
      System.Uri theURI = new Uri(url);
      win.Navigate(theURI,"new");
   }

}

Separating Code From UI

Of course, none of this code affects any of the effects of displaying, spinning, or animating the buttons; in fact, the event handler has nothing to do with the template; it is just a plain old button.click – part of the principle that Templating affects the UI but not the logic of the control.

More Soon

More soon once the tutorial and videos are out; and again, I apologize for blogging before the fact, but my enthusiasm got carried away and I had to answer Seth’s question.

Posted in z Silverlight Archives | Tagged | Comments Off on Look Ma’ No Code

Don’t Believe Anything I Say

 

 

That is, don’t believe anything I say when you ask me about Silverlight vs. some other technology such as… well the one people keep asking about is Flash (or Flex). 

Here’s why.

1. Once a person has a stake in a product that person is physically incapable of having an Yellobjective opinion. In my experience that is a fact of life no matter how honest, reputable, sincere or incorruptible the person. Set aside cigarette scientists and those who work for (your pick: nuclear power companies, pharmaceuticals, etc. etc.) – when a company is feeding your children you cannot be objective about their product

2. There is more than one way to have a stake in a company, and perhaps the biggest is “sunk cost” and “cognitive dissonance” – in short, no one likes to (a) think they made the wrong choice (b) think the investment they’ve made in learning a technology may have been wasted or (c) wants to “start over.”  So moving a .NET programmer from ASP.NET to Silverlight takes less force per unit of time than moving a Flash programmer.

3. There is no objective standpoint.  No one is standing on a planetoid [1] objectively assessing Silverlight against any other product, nor could they.  Every assessment you read, from within Microsoft, Adobe, or from the Media is written by a person who brings their [2] own history, agenda, bias, etc. 

4. There are not objective criteria.  Even if you could be objective, what criteria would you use? Each company has its own needs, not only for a specific project but also in terms of the staff and budget available. You don’t fight the next project with the team you want, you fight it with the team you have. Oops. A Rumsfield moment. 

Okay, I’ll say this: I’m may not be the programmer I want to be, but I’m the only programmer I have, and I come to my work with two decades of experience, working in CPM, RSTS, DOS, Unix and then Windows since 1990 and .NET since 2000. 

If I want to write an RIA, Silverlight is the natural fit; the fact that it is incredibly great, and that it is getting huge support from a very innovative group within an incredibly well funded company makes it a no-brainer – for me. 

Topic for a different column: The three most encouraging events in the Dev-Div in the past decade are, in my opinion, the creation and release of Xaml, the hiring of Ray Ozzie and the promotion of ScottGu to VP; all of these signal an innovativeness that is almost shocking in an organization of this size.

Testimony

My personal testimony to Silverlight is that after attending Mix07 I immediately incorporated Silverlight Consulting LLC in Massachusetts just long enough to be offered this job, for which I gave up 12 years as an independent. Silverlight is, in my eyes, the most exciting technology since .NET, possibly since Windows 3.1. 

Focus

Since I’m not great at "my software is bigger than yours”  I spend my time referring “is this the right technology for my company” questions and especially “how does this compare with ….” questions to others (who are better at it). But, understandably, the questions keep coming. So I tell my story of how and why I chose Silverlight and gently refer the questioner to those who have the comparative facts at their fingertips [3]

Then I try to focus on “how do I accomplish this in Silverlight” questions and, lately “what do I need to know, and why?” questions.  I try to remember that I’m a developer, and to get better at writing code and at teaching and presenting and reminding folks not to believe anything I say.

——-

Footnotes

[1] "No one is standing on a planetoid "   —   Saw a bumper-sticker: “Awww – Let Pluto be a planet.”  

[2] "a person who brings their own history" We really need a gender neutral pronoun.  

[3]  " who have the comparative facts at their fingertips"   Just because there is no objective standpoint and there are no objective criteria for all situations doesn’t mean that we don’t have objective comparative facts; I just don’t happen to know them.

Posted in z Silverlight Archives | Comments Off on Don’t Believe Anything I Say