Twitter killed my blog

image

The other day i saw a quote from Ambrose Little that couldn’t have been more accurate about Twitters impact on my life.  Simply put, it has killed my blog.  Instead of blogging about smaller items or topics, it’s so much easier, and faster, for me to microblog (i.e. tweet)  instead blog.  From the surface it’s seems great: my time is reduced in composing, it’s now just 140 characters, and it cuts down on your time because you can quickly digest information.

I think it’s time to take a step back and really determine what should be blogged, and what should be tweeted?  This will take time to answer, and there will be many opinions for both.  For me I am going to start erroring on the side of Blogging.

More to come.

Triggers in Silverlight 3

Did you know there is a built-in Trigger in Silverlight 3?  It’s the the Loaded event of objects.  There’s been a fair bit of attention given to Behaviors, and rightfully so, but sometimes you simply want a trigger.

It would be great to have more Triggers in SL, but for now, let’s take a look at the Loaded trigger.  It’s particularly interesting because you can handle the visuals of an element becoming visible.  Adding a build on (like fade in) transition to your elements in your application is something small, but adds polish, and should be encouraged.

The below Xaml shows the fading in of the LayoutRoot using the Loaded Trigger.


<Grid x:Name="LayoutRoot" Opacity="1">
  <Grid.Triggers>
    <EventTrigger RoutedEvent="Grid.Loaded">
      <BeginStoryboard>
        <Storyboard x:Name="LayoutRootLoaded">
          <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
              Storyboard.TargetName="LayoutRoot"
              Storyboard.TargetProperty="(UIElement.Opacity)">
            <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0" />
            <EasingDoubleKeyFrame KeyTime="00:00:05" Value="1">
              <EasingDoubleKeyFrame.EasingFunction>
                <ExponentialEase EasingMode="EaseOut" />
              </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>
          </DoubleAnimationUsingKeyFrames>
        </Storyboard>
      </BeginStoryboard>
    </EventTrigger>
  </Grid.Triggers>

Unfortunately I haven’t been able to find a way to edit a Storyboard defined in a Trigger.  For right now you’ll have to create the Storyboard in the Resources and copy into the Trigger.

Convert string to Color

Here’s a quick function on how to convert a Hex string to a Color in Silverlight.  Grab the code here.

image

SketchFlow Control Explorer

In a previous post I showed a screenshot of all the controls available to you in SketchFlow.  The below application takes it one step further by displaying the live controls.  For the record, the SketchFlow styles are re-distributable.

Install Microsoft Silverlight

Testing Silverlight from Windows Live Writer

Today SmartyP (did you get that Roger, I didn’t use your name) was letting me know what Grinds his Gears which is: Why do Silverlight bloggers not embed Silverlight applications into their posts.  Admittedly, I don’t have a single post that has an embedded Silverlight app.

The root of the my problem is the lack of support for embedding Silverlight into Windows Live Writer (WLW).  It’s possible, with Wordpress, to embed Silverlight through the web interface, but WLW’s features outweigh what the web dashboard can do (namely pasting in screen shots without having to save them to the file system and then upload).

After a little digging tonight, I came across this post by Erno de Weerd.  It details how to embed Silverlight apps into Windows Live Writer.  FWIW, this method uses Tim Heuer’s Silverlight Wordpress Plugin.

Without further ado…drum roll…here’s the test:

Install Microsoft Silverlight

Finally, completely unSilverlight related, I always reference Grinds his Gears. It’s such a great line, you can complain without complaining.

First InsideRIA post!!

Today marks my first post on O’Reilly’s InsideRIA.  It was about last weeks Silverlight 3 / Blend 3 launch.  Fore more…here’s the link: http://www.insideria.com/2009/07/silverlight-3-launch.html

image

Overview of Sample Data in Blend 3

One of my favorite, if not my favorite, feature of Blend 3 is Sample data.  At the beginning of a project I often create a simple XML file to represent the data I’m expecting.  This enables me to focus on UI tasks while the backend services are being created.  Designers generally don’t go as far as creating sample data themselves, they generally hard code all the data in their comps.  When the design is handed off to developers the UI has to be recreated from scratch.  Needless to say, this process is manual, flawed, and unharmonious.

[put in a diagram]

Sample data in Blend 3 enables designers and developers to quickly add data without much effort (no more creating XML by hand!!!!).  This post gives an visual overview of what sample data is.  In a later post I’ll show how to apply Sample data to a ListBox.

Creating Sample data

The below diagram illustrates the following steps:

  1. Open a project in Blend 3 and locate the Data panel (this is located on the right side of the screen in the same area as the Properties and Resources panel). 
  2. Click the Add Sample Data button in the top right of the Data Panel. 
  3. Select Define New Sample Data.  The other option, Import Sample Data from XML, enables you to bring in data you’ve created by hand.
  4. After selecting Define New Sample Data the a dialog box opens asking for a name, the scope of the data, and if you want the data to be enabled during runtime.  Once the settings are the way you like them, click OK
  5. Finally, the Sample data is created.

image

Add a Property

Properties are very powerful and rich.  Blend enables you to define strings, numbers, booleans, and images.  At first, the interface looks unassuming and you probably won’t trust it to create the type of data you want.  Give it a spin to see how powerful.  The below screen shots show the different types and options available for each.

String

image

Numbers

These are integers.  The Length property sets many digits you want.

image

Booleans

When bound, boolean data types render as check boxes.

image

Images

Once again, an unassuming options menu, however this is probably my favorite property.  Specify a directory and Blend grabs all the images to use as sample images.

image

Edit values

After creating your properties, you may want to change values of the sample data.  To do this, click on the Edit sample values button in the Data panels tab.  This brings up the Edit Sample Values dialog box.  Here you can directly work with the data.

image

Delete a Property

To delete a property is fairly straight forward, with one catch, you aren’t able to use the delete key on the keyboard.  Instead highlight the property you want to delete, right click, and selected Remove.

image

Using Sample data

Now that you’ve created the sample data, how do you use it?  The easiest way is to create a drag and drop the data on a Items control.  The below figure shows the sample data being dragged onto a ListBox.

image

This is the resulting ListBox:image

SketchFlow Controls

Do you remember those laminated quick reference sheets that college bookstores sold.  They were suppose to be quick reference guides or cheat sheets, and were perfect impulse buys.  For the most part they ended up being worthless pieces of crap.  Did you really want to be that guy who pulls out a large laminated quick reference sheet?  (As a side note, rather a confession, I remember having one for Word and Excel.  Talk about a misguided Christmas present).

On with my point, this post is intended to be a laminated quick reference for Sketchy styles in SketchFlow.

image

For more info check out:

Alan Lee’s SketchFlow Demo Video from Silverlight 3/Blend 3 Launch Event

Christian Schormann’s Expression Blend 3 with SketchFlow Available for Download & SketchFlow Concepts: An Overview ()

Editing a ToolTip Style in Blend 3

ToolTips are a great way to display mouse over information, while increasing your applications accessibility.  UI designers are increasingly demanding the use of rich overlays in applications.  Meaning, instead of a standard Tooltip, a designer might want to add polish by adding animation or having a rich UI to a overlay.  Initially you may consider wiring up a MouseEnter and MouseLeave event, then handle an overlay through the code; however, I would encourage you to take a look (or second look) at the Tooltip.

Out of the box, styling a Tooltip in Blend is a manual process.  The below screenshots/descriptions show how to do this.

  1. First, add a Tooltip; do this in the Xaml view to look like the below Xaml.image
  2. Next, click, in Xaml, on the <ToolTip tag.  This will change the breadcrumb at the top of the Artboard to show [ToolTip].  Click on the breadcrumb and select Edit Template > Edit a Copy.

    image

  3. After creating the Template, there is a chance your Artboard will look like the below image.  You’ll notice that you’re in the context of editing the ToolTip template without visuals.  If you experience this, go to step 4 to see how you can edit the visuals.

    image

  4. To edit the ToolTip, click the Resources tab, locate the ToolTip style, right click and select Edit.  The Artboard will show the visuals for the ToolTip.  You can now edit the ToolTip like any other control.

    image

YouTube video in Silverlight 3

A while back I saw a post titled something like Displaying YouTube Videos in Silverlight.  The implementation included a Windowless Silverlight application with a Flash video player on top.  Video controls were implemented in Silverlight, and were wired up with JavaScript.

YouTube is moving toward the h.264 encoding for their videos.  (My guess is to prepare for HTML 5.  It’s crazy to think that YouTube could/might move away from Flash.)  Silverlight 3 is a benefactor because it can support h.264.  If anyone is looking for a great mashup, make a Silverlight video player that integrates with the YouTube API.

To be explicit, this post is not about using the YouTube API; it is a proof of concept.  I used the YouTube HD Ultimate Greasemonkey script to get the url of an HD video from YouTube, then used it as the source for the MediaElement. 

The below screen shot shows the Silverlight poc on the left (notice the Silverlight menu) and the actual YouTube video on the right.

image

 

The code & example

Code - http://85turns.com/silverlight/zips/YouTubeHDTest.zip

Example - http://85turns.com/silverlight/YouTubeHDTest.html