All you ever wanted to know about WPF and Silverlight and XAML, Microsoft Expression Studio and more.

The Future of Expression Blend

by Don Burnett

IE 8 Beta 2

Internet Explorer 8 Beta 2 is out, it runs directly in STANDARDS mode.. It does fairly well with a few of the javascript benchmarking "spiders" on the web and with the ACID Test it's not too bad either. The only thing is lack of SVG support which ACID is bent on adding while it's not a standard for graphics that many companies neither support or provide plug-ins for browser support either. I think they added SVG to ACID just as a rub against IE.. That's pretty unfortunate if you ask me..

The new features are quite useful. The most exciting for me is the new search box next to the address bar at the top right of the screen it lets you type a search term, and with a "you select it" plug-in search provider easily specify which of multiple search engines to use. In this world of "one size does not fit all" search engines, where diversity and subjective search is king, this is a really great new feature.

image

They have also addressed the problem of rabid spyware cookies nicely with this new feature that doesn't "hansel and gretel" you into the oven with your boss or other users..

image

InPrivate Browsing prevents Internet Explorer from storing data about your browsing session. This includes cookies, temporary Internet files, history, and other data. InPrivate Blocking helps prevent the websites you go to from automatically sharing details about your visit with other websites. To help protect your privacy, some website content might be blocked. To exit this mode you simply close the browser window that you turned on in private mode.

They have also made compatibility with previous browsers mode (now not just IE 7 emulation mode anymore) with a Compatibility View option that works much the same way. You do have the option however of specifying which websites with this (I don't notice an option like this for inPrivate mode that sticks out but maybe it's there). One great example this morning of needing to use this was the betanews site, which is blank in IE 8 standards mode, without turning on Compatibility View. I hope the betanews team is checking stuff like this out..

image

 

Expression Blend's Future

WPF contains a great and very extensive content language based on XML called XAML.. This have been pretty exciting over time, and the product seems to be branching in several different directions lately. Recently I blogged about the prototype of the Visual State Manager for WPF, which while just a prototype really shows Microsoft's commitment to improving the state of functionality and bringing parity to XAML in both Silverlight and WPF.

I'd like to spend sometime talking today about some wonderful capabilities that are built into WPF that the average developer and designer might not know about. I spend quite a bit of time doing UI consulting and I get asked quite often about the direction of Microsoft Blend and what it supports. Microsoft has been very kind to me over the last year and opened their doors to me so that I might go ahead and catch a glimpse into the future of things. While I can't talk about anything like that (I suspect I'd find myself in Arkham Asylum for the next fifty or so years)..  I would like to talk about some things you can do with WPF that you can't do with Blend right now, and I still find myself wondering if we will ever be able to do any of these things natively in Blend.

Now most of this applies to creating Windows Platform applications, not Silverlight which is at the moment a bit less capable in the triggers and bindings department due to the fact that it's a web browser plug-in which limits it much to what the web browser can do..

However I get asked about things from time to time and it's a stumbling block for many developers.. Web developers have it easy thanks to tools like DreamWeaver which pioneered add-ins for an HTML web development package. I am happy to announce that many of these features have made it's way to Expression Studio, and even now Expression Blend. In the latest 2.5 Blend preview beta, there is now a Blend Add-in API which has been added.

For instance I could add a Menu to Blend with my own content very easily..

AddInDescription("DonsPlugin", AddInCategory.Tool)]

public class HelloWorld : IAddIn

{    

public void Initialize(IApplicationService applicationService) {}    

public void StartupComplete()    

{         // Show we were here        

           System.Windows.MessageBox.Show("Just kidding but my own space in blend, great idea!");    

}    

public void ShuttingDown() {}     IDisposable Members }

then call it up from Blend 2.5 like this:

c:>C:\Program Files (x86)\Microsoft Expression\Blend 2.5 June 2008 Preview\blend.exe /addin:DonsPlugin.dll

At the moment since Blend 2.5 is a beta to get at it you have to launch the program from a command line that specifies whatever add-in you need. But there is now one really great Blend add-in that I have to tell you about that will make your XAML coding much more delightful.

 

"Intellisense" for Expression Blend?

Robby Ingbretsen of "Identity Mine" fame has always been publishing great new things and extending XAML and many ideas from Blend. I have to give him Kudos for the  latest release of his Kaxaml XAML editor. It's nice and lightweight enough to prototype XAML code (even on UMPCs) and it gives you one thing Blend does, a feature that works a lot like "Intellisense" for Microsoft Visual Studio.  This allows you to type the first element  of a XAML tag and get a pop up dialog with the syntax of rest of the code. If you are typing code it's a time saver and very useful. This caused me also to spend a lot of time in Visual Studio because I like coding in XAML quite a bit. There are times when a feature like this really comes in handy if you don't quite remember the syntax or possible options in a language tag. This also makes Robby's editor quite unique and more useful than something like XAML pad..  His editor now supports Silverlight 2 as well as WPF XAML now and I suggest if you are doing any serious work you have this installed in your arsenal.

Well Stefan Dobrev  of "Telerik" fame, has  ingeniously has melded Robby's "Intellisense-like function" to Blend's add-in function found in the new beta, and are you ready for this, we now have an "intellisense" type add-in for Blend 2.5. So the editor in Blend 2.5 just took a quantum leap in functionality.. You can download it right here.. There is also more information at Stefan's Blog..

I should advise you though at the moment there are a couple of things to know that it lacks support for..

  • No support for custom namespace types and custom attached properties.
  • Currently the Silverlight support is not accurate, because it is using the WPF XML schema for IntelliSense information (very fixable though)

    image 

     

    Blend: Things I'd like to see gain support..

    We may not need these anyway, but I'd like to see some things in WPF supported in Blend and used in Blend's creations.. We all know about this Visual State Manager goodness, but how about some goodness for bindings and custom bindings..

    <MultiTrigger>

    Property and data triggers let you set properties when properties change. Event triggers let you trigger events as they happen. While both are pretty different, you can’t set a property with an event trigger or raise an event with a property or data trigger—they do allow you to add interactivity to your applications in a wonderfully declarative way with little or no code.. Just as property triggers can be combined into "and" conditions using the MultiTrigger element, data triggers can be combined using the MultiDataTrigger element.  This works a lot like Visual State Manager right now... Let's look at an example..

    First lets look at a single trigger example that sets more than one property:

    <Style TargetType="{x:Type Button}">

    ... <Style.Triggers>

    <Trigger Property="IsMouseOver" Value="True" >

    <Setter Property="Background" Value="Red" />

    </Trigger>

    </Style.Triggers>

    </Style>

    What if you had a lot of these.. How could you make it easier? How about this..

    <Style TargetType="{x:Type Button}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True" >
    <Setter Property="Background" Value="Red" />
    </Trigger>
    <Trigger Property="IsFocused" Value="True" >
    <Setter Property="Background" Value="Blue" />
    </Trigger>
    </Style.Triggers>
    </Style>

    Wow multiple Triggers on the button with many states and different properties set. Can you see goodness?? You can do this right now today, you just have to do it in code.

    Multi-Conditions too?

    <Style TargetType="{x:Type Button}">
    <Style.Triggers>
    <MultiTrigger>
    <MultiTrigger.Conditions>
    <Condition Property="IsMouseOver" Value="True" />
    <Condition Property="Content" Value="{x:Null}" />
    </MultiTrigger.Conditions>
    <Setter Property="Background" Value="Red" />
    </MultiTrigger>
    </Style.Triggers>
    </Style>

    Okay lets move on now to other things.. just remember that property triggers will only let you set and check WPF dependency properties, not your own.. That's not to say that you can't check your own or any .Net Properties either..

    Data Triggers

    This is where everything gets really cool and saves you time, hassle and life.. Especially when you have a very long bound data situations..

    Let's take a moment to review Databinding in XAML..

    <Label Content="{Binding Path=MyTime*60}"></Label>

    Wait that won't work will it? Why? Because XAML doesn't support binding to a calculated value.  I see this as a major setback to anyone expecting to use a CLIENT WPF application with data that is calculated on the fly. It also seems like a very serious limitation. But XAML thanks to XML is a very flexible language. Value Converters to the rescue...

    <Label Content="{Binding Path=MyTime}, Converter={StaticResource myTimeConverter}"></Label>

     

    Okay now that we have looked at that, wouldn't it be nice to be able to check a .Net property with some value on it and do some conditional triggering based on a value stored in a .Net property?  Well data triggers allow us to do this right now..

    <Style.Triggers>

    <MultiTrigger>

    <MultiTrigger.Conditions>

    <Condition Property="IsMouseOver" Value="True" />

    <Condition Property="Content" Value="{x:Null}" />

    </MultiTrigger.Conditions>

    <Setter Property="Background" Value="Yellow" />

    </MultiTrigger>

    </Style.Triggers>

    </Style>

     

    I hope we see this and many more WPF features make their way to Blend. Anyway we'll visit some more of this in another article soon..

     

     

     

  • » Similar Posts

    1. WPF Development- For Developers working together with a Designer
    2. What's Missing from Vista?
    3. Cool New Silverlight Toolkits Blaze Forward

    Comments are closed