Feeds:
Posts
Comments

Archive for January, 2007

Thanks to you, one of my articles made the top 100 wordpress list.  Your emails and comments have made the first month of WpfWonderland  interesting and fun.

Here are your favorite articles from January

WPFe Example – the game of life
Comparing WPF applications and XBAP – Wh
Latest version of Reflector can dissembl
WPF Sample – ColorComb
iPhone UI – WPF can do that!
Free WPF datagrid component from Xceed
WPFe Example – Happy New Year 2007
WPFe Example – Virtual Earth overlay
First WPF 3D short film debuts on your l
Flickr + Thirteen23 + WPF = One cool app

 

-Walt

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Today is Vista launch day.  You may be excited by the prospect of running Vista on your computer or you may think it’s a ho-hum moment.  I’m excited though.  Every computer shipping with Vista installed is gaining a powerful new UI rendering engine, whether the consumer knows it or not.

I’m even more excited that Tim Sneath is publishing a series called ‘Great WPF Applications’.  He’s planning on showing all the interesting WPF applications that have crossed his path during the last  year.

Many of these WPF applications have been in stealth mode during development.  The result of this cone of silence is a skewed perception that WPF  is not ready for prime time or that no one is using WPF to build rich UI applications.  That’s unfortunate, but I think the perception is about to change.

Tim’s first article in the series features a beautiful book viewing platform written for the British Library.  Read Tim’s article, he explains a lot about the application, who wrote it, what unique problems they had to solve, the benefits provide by WPF and so on.  BTW the complete app was written in 3 months.

Take me to the Turn the Page application

-Walt

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

A couple days ago I wrote about the free WPF datagrid component from Exceed.  This is good news for WPF developers for a couple reasons.  One, we get a practical datagrid to use in our applications.  Two, the datagrid is a good showcase for WPF.  We can see what kinds of components can be written in WPF.

I think it’s good PR for Xceed too.  By getting a working WPF component out early and giving it away for free they gain market share and mindshare in the WPF community.

The idea

I was thinking about this the other night when I was struck by a new thought. It lit my mind like a streak of lightning sizzling across the moonlight sky. Zzzaap!

 

  –XBAPs are the perfect way to demo your WPF product–

 

If you haven’t seen the Exceed demo yet I recommend  that you check it out and see for yourself what they have done.  Exceed’s XBAP demo is a suburb way to show off their new product.  Its more than just code.  Its interactive, which is better than watching a video.  It nudges you along the demo path with informational balloons and pointers. Go see what I mean.

It’s a brilliant use of  WPF technology. I’m suggesting that you consider the same for your product.

The problem

Your company builds tools for WPF developers.  You want to show the world how nifty your latest WPF tools are.  What are your options?

  • Create a demo app and distribute on DVD at trade shows and conferences
  • Give away free copies of your software with SDK demos
    • Time cripple the app
    • Limit features in app
  • Film a Videocast of the application demo and post on your website and other video sites
  • Hire a Flash team or Adobe Director company to build an interactive demo
  • Attempt a web-based demo

XBAP solution

Xaml Browser Applications (XBAP) are full featured WPF applications.  There are a few differences between them, which I’ve listed here, but XBAPs can do nearly everything that a standalone WPF application can do. That is what makes this so intriguing.  You can showcase your product – via WPF and deploy the demo via the browser.

So what do you do? Now you want to build and deploy an XBAP demo:

  • Have your demo gods whip up a WPF demo (XBAP) that shows off your tools finest features. 
  • Make the UI for the demo, the marketing screens, the information and sales pages, beautiful and compelling via the rich WPF graphics engine. 
  • Upload the XBAP to your webserver.
  • Invite your customers to experience your latest release.

Limitations

There are a couple caveats.

  1. Your customer must have the .NET 3.0 runtime  installed.
  2. Your customer has to visit your demo site with Internet Explorer.

How big a limitation is this really? Let’s think about this for a second.  You are trying to sell your toolset to the WPF community.  What are the chances they would have .NET 3.0 installed already?  Very high, I bet. How many of them have IE?  A better question would be how many of them use Firefox.  Probably a high number, but to use your demo they could switch to IE for a few minutes.

I see so much potential for this idea.   If you are selling WPF tools you really should consider XBAP demos.

-Walt

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Quick summary of the differences between XBAP and Standalone WPF applications.

Standalone WPF applications

  • Installed on users computer
  • Appear in Start Menu and Add/Remove Programs.
  • Installed via MSI or ClickOnce
  • Code Access Security
    • Run in Full Trust unless modified by Administrator
    • Capabilities within zone
      • Spawn children windows
      • Use WCF
      • Access registry
      • Read/write to file system
      • Any other full-trust task
  • Runs in its own standard OS window
  • Newer version may not be automatically installed on users computer
    • ClickOnce can automate this process
    • User may opt out of updates (use older version)
  • User can be offline and use application

XAML Browser Applications (XBAPs)

  • Not installed on the client’s computer
  • Do not appear in the in Start Menu or Add/Remove Programs.
  • Are automatically deployed via ClickOnce
    • YourApp.xbap is really a ClickOnce deployment manifest
  • Code Access Security
    • Run in Internet Zone (sandbox)
    • Security exception thrown if attempt made to access unauthorized areas
    • Capacities within zone
      • Isolated Storage
      • No calls to WCF allowed
      • Only tasks available in Internet zone
  • Additional security
    • WPF removes device driver privileges from the browsers process token
  • Hosted in browser process
  • Only run in IE browsers
  • WPF restrictions
    • Can use 99% of WPF features
    • Cannot use BitmapEffects
  • Newer version always installed
  • User must be online to use application
  • User must be able to see deployment webserver

 

-Walt

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Jonathon pointed out a flaw in my BAML article. I made it sound like downloading the latest version of Reflector was all you had to do.  That’s not true, you also have to download another tool. I guess wasn’t too clear in explaining how Reflector creates XAML from BAML.  Here is a more detailed roadmap.

Lutz Roeder has created a tool, BamlDisassembler (update on March 10,2007, new addin for Reflector 5.0 is available. BamlViewer )), that reads BAML from an assembly resource and converts it to XAML.  You can run BamlDisassembler at a command prompt like so:

BamlDisassembler input.baml output.xaml

Viewing XAML

You can also run BamlDisassembler from Reflector.  This is what I was trying to say in my previous article.  Here’s how:

  • In Windows, register the .baml file extension with BamlDisassembler. 
  • Run Reflector
  • Open the WPF assembly in Reflector
  • Click the resources folder in the WPF assembly
  • Click the *.g.resources node
  • Double click the *.baml  file
  • Enjoy reading the XAML

-Walt

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Would you like to see an odd little movie?  Japanese design house Bascule released the first ever short film produced with WPF — Dominoken. 

This offbeat little film, featuring a cast of 2D/3D digital actors  follows the trials and tribulations of a Japanese short order cook facing a chaotic night of dominoes, sushi, rice bowls, and more.  Could this be the start of WPF night at the movies?

Show me Dominoken  (must have .NET 3.0 installed)

 

 

-Walt

Read Full Post »

A frequent complaint about WPF from potential WPF adopters is the lack of a real datagrid.  WPF has the powerful layout panel (Grid) but it a  layout element only.  Its real mission is to provide a way for you to organize your UI elements, not show your database data.

Traditionally third parties come along and fill in the gaps in Microsoft product line with control libraries.  Often these libraries are huge and expensive.  There was a lively datagrid market for Visual Basic developers back in the mid ’90s for example.

It looks like the same thing is happening with WPF.  I’ve encountered many commercial component programmers at WPF events and we’re starting to see releases of component libraries.

Free Datagrid

Exceed just released their own WPF datagrid.  I haven’t had time for a full review of the tool yet but it seems to be very useful from the quick overview I had last night.  The best part — the datagrid is free.  This doesn’t appear to be a limited time offer either.  Now you’ve really got no reason to put off adoption of WPF :>

Screenshots

I’ll have a more detailed post later but here are a couple screenshots to keep you happy.

Applying themes to the grid.

Grouping data in grid.


Validation

-Walt

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

I can’t tell you how many .NET developers use Reflector.  But I’d guess it’s about 99.9999999%. Lutz Roeder continuously updates Reflector as new .NET frameworks are shipped. 

XAML Source

When you build a WPF application inside Visual Studio the compiler creates a Binary Application Markup (BAML) file.  This is a binary representation of XAML auto-genned by Visual Studio.  I was happy to hear that Reflector can show me the XAML for these files.

This is great news.

See my more recent post for details on how to setup up Reflector correctly to recognize BAML files.

-Walt

Read Full Post »

WPF and charts are a perfect match.  WPF can render amazing graphics, so it is likely that many component developers are working on WPF charting tools.

I found a WPF prototype (SwordfishCharts) on Code Project that is fun to play with. 

Interesting Features

  • Tracking Cursor – point on chart follow the mouse
  • Zoom -right mouse button zooms in on data
  • Pan – left mouse button pans the chart

-Walt

Read Full Post »

You’re excited about WPFe and install the SDK.  You start working on your first application in Visual Studio.

“Hey, where’s the intellisense?” 


A fresh install of the WPF/E(Sliverlight) SDK doesn’t support intellisense. Don’t fret, I’ve found the solution.

 

The Fix

Copy the WPFe schema file to your Visual Studio folder.  The following assumes you installed the apps in the default location.

C:\Program Files\Microsoft SDKs\WPFE\Help\XSD\wpfe.xsd
   to   
C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas

 

Be sure and add the following xmlns tag inside your root element.

<Canvas xmlns=http://schemas.microsoft.com/client/2007
     xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml />

Edit – thanks to Sam Barber for the reminder

  -Walt

Read Full Post »

We haven’t even begun to see the power of WPF/E(Silverlight) applications.  Wpfe is still in infancy (not even in beta release) and  programmers are making their first exploratory applications.  Trying ideas out before buying into that new technology.

Much of the web communities attention is focused on AJAX, which is changing the way we think about web UI. There are 100+ AJAX frameworks in active development and companies all over the world trying to see how far they can stretch the AJAX model. 

I think WPF/e is another technology that will change the way we perceive web UI.

Here is a little WPF/e experiment from Marc for you to check out.  It layers WPF controls, stickpins and images over the virtual earth maps.

Show me the WPFe example

-Walt

Read Full Post »

The new WPF/E(Silverlight) Developer Content site is starting to get some instructional content.  Their latest post answers one of the questions that I get asked frequently.  How do I create a reflection in WPFe?

 

Find out how here

 

-Walt

Read Full Post »

The latest version of Visual Studio (codename Orcas) is available on the download servers at Microsoft.  I talked to Mark Boulter earlier this week and he says that the new WPF designer bits (codename Cider) didn’t make it into the latest build.  He said they barely missed the deadline.  I suspect that they’ll be in the February CTP.

In the meantime, use the beta version of Expression Blend, to layout your controls.  The Visual Studio 2005 extensions are very rough around the edges.

What else is in the CTP

  • LINQ for Objects is working
  • LINQ for SQL is shaky
  • LINQ support for VB is limited

More details 

 

-Walt

Read Full Post »

Layout Quirks in WPF

Occasionally the layout engine in WPF can arrange your elements in an unexpected pattern.

The Goal

Let’s say you want to have a simple form for data entry.  You want some instruction text ( static multi-line) at the top of the form.  You also want a multi-line TextBox for data entry.  Sounds simple so far.  You want the form to look like this. 

 

Note:  I’m not advocating the green and blue colors for your UI.  I’m using them to help differentiate the label from the textbox.

 

Using a Label

If you come from a WinForms background the first control you are going to use for the static text is the Label.

 

    <DockPanel HorizontalAlignment="Stretch" >
        <Label
            DockPanel.Dock="Top"
            FontSize="16pt"
            Foreground="Black"
            Background="LightGreen"
            HorizontalAlignment="Stretch"  
            >

            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. [text snipped] 
               </Label>
       
        <Border BorderBrush="White" BorderThickness="4">
            <TextBox
                Name="MyRichTextBox"
                FontSize="40pt"
                Foreground="Black"
                Background="LightBlue" 
                AcceptsReturn="True">

                Type your text here...
            </TextBox>
        </Border>

    </DockPanel>

This is what you see.

As you can see the instruction text is only one line high and the the text is truncated.  In WPF, the label control is not your best choice for multiline text.  The label does have one unique advantage over all the other controls though.  You can specifiy an keyboard accelerator and a affiliated control.  So you can link a label to a listbox, specify an accelerator key  and when the user presses the key the focus moves to the affiliated control. 

 WPF has a rich assortment of classes for working with text.  Here are a couple:

  • Label
  • TextBlock
  • Textbox
  • RichTextBox
  • FlowDocument

 

TextBlock:  Intended for showing single lines of formatted text.  Textblock can show a mixture of font colors, styles, fontnames and sizes.  It can show multiple lines, but will quickly show it’s limits.

TextBox: Holds more content than TextBlock.    Shows unformatted text only. It has built in support for Cut, Copy and Paste.

RichTextBox:  Holds more content than TextBlock,  Similar to Textbox plus supports formatted text.

FlowDocument:  Huge documents, supports formatted text, support for most document concepts like style, numbered lists, bullets, columns, embedded images.

Textblock

Since the label didn’t help us accomplish our goal lets look at the TextBlock.  It looks like a good candidate.  It has limited multi-line support and formatted text.  Change the XAML to:

    …

<DockPanel HorizontalAlignment=Stretch >
        <
TextBlock
           DockPanel.Dock=Top
           FontSize=16pt
           Foreground=Black
           Background=LightGreen
           HorizontalAlignment=Stretch
           TextWrapping=Wrap

             >
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. [text snipped]
        </TextBlock>

Hmmm.  Not exactly what we’re looking for.  The TextBlock is centered by setting the  HorizontalAlignment=Stretch” attribute.  But you can’t make it occupy the entire width of the DockPanel. 

Now some of you are looking at this and thinking “That’s not right.  I’ve seen TextBlock fill the space.”

You’re correct. But here is one of the quirks of WPF.  The DockPanel is inside a Window element.  If you change the Window element to Page this is what you’ll see.

Why does placing the TextBlock in a Window element have this odd behavior?  I’m not sure.  If you know why, add a comment to this post.

TextBox

If you change the TextBlock to a TextBox, it works correctly in both Page and Window.  Since my goal didn’t specify that we wanted formatted text the TextBox is just what we need.

-Walt

Read Full Post »

WPF has design tools for designers (Expression Suite) and tools for developers (Visual Studio).  There is a new video training site just for designers that launched this week.

ContentPresenter.com

Started by the amazing Lee Brimelow, ContentPresenter is targeted directly at the designer community.  Lee has a ton of sites, including the wonderful Flash tutorial site GoToAndLearn

Here what Lee says about his new site.

ContentPresenter.com is a free WPF tutorial resource that I created to help interactive designers learn this exciting new technology. Most of the available tutorials online are too technical for most designers to follow and the majority are produced for .NET developers who are trying to learn WPF. WPF offers so many incredible visual design possibilities for creative types and I’m hoping that this site helps people in getting started. There will be a lot of programming in these tutorials so graphic designers with no prior coding experience may have difficulties. These tutorials are primarily geared for interactive designers who are used to using tools like Flash.

I know that my planned videocasts are targeted at the developer community.  Even if you’re a programmer go watch some of Lee’s videos anyway.  You might learn something interesting.

-Walt

Read Full Post »

Older Posts »