Expression Blend and Design

The team blog of the Expression Blend and Design products.

  • Expression Blend and Design

    Expression Blend -- What Is That?

    • 4 Comments

    Expression Blend is an authoring system for professional designers to build user experiences that target the .NET 3.0 platform, and more specifically, WPF, or Windows Presentation Foundation.

    WPF provides the platform to bring rich, animated, skin-able, UX envelope-pushing applications to the desktop. Applications that blend content, media and user interface into real user experiences. WPF provides sophisticated vector graphics and blurs the distinction between user interface and content. You can create applications with custom looks, and you’ll have more flexibility and ease than ever before.  You are able to animate pretty much anything, and you can use data binding to create user interfaces from data. You can integrate images, video and 3D, and you get a set of text layout features well beyond what you would expect from a user interface platform. And WPF scales: Blend itself is not only entirely written in managed code, but it also is a WPF application head to toe.

    We strongly believe that designers will have a dominant role in creating these envelope-pushing user experiences we are targeting with WPF. Alas, WPF is an SDK, a software development kit, and not particularly designer friendly. And this is where Expression Blend comes into play. Blend is a visual design tool for WPF, providing a designer-friendly look at all the power of WPF. You can draw and animate like in media authoring tools, but you also have access to components, controls and layout, data binding and all the other features of WPF that make user experiences come alive.

    Rich client applications tend to have a lot of code and functionality. Because code is such an essential part of application development, we believe that Blend will often be used in teams of developers and designers. Blend plays very nicely in environments where design and coding are important – collaboration and interchange with Visual Studio is a big part of the solution.

    If you are developing or designing WPF-based applications, we hope the Expression Blend will blend right in and allow your designers to take much more control and responsibility in the overall process!

  • Expression Blend and Design

    Using Design-Time Attributes to Categorize Dependency Properties in User Controls

    • 7 Comments

    In most cases, when you create user or custom controls, you will expose dependency properties to allow you to set values or make modifications to your control directly via XAML. Because XAML is the language of Blend, Blend will expose those dependency properties in the property grid itself. For example, let's say you have a user control that displays information in a colored box:

    helloWorld

    This user control has two dependency properties. The first property is called QuickInfo that displays some text such as "Hello World!", and it returns a value of type String. The second property is called BackgroundColor, and as its name implies, sets the background color of our user control. As you may guess, the BackgroundColor property returns a value of type Brush.

    Default Behavior
    In Blend, if you select a user control on the design surface, by default, any dependency properties you expose are displayed in the property grid. Blend looks at the return type of each dependency property and categorizes it in the appropriate location accordingly.

    For example, our BackgroundColor dependency property will find its way into the Brushes panel because it returns a value of type Brush:

    bgColor

    Our QuickInfo dependency property isn't quite as lucky. Because QuickInfo simply returns a string, Blend doesn't know exactly where to place it. Any dependency properties you create that can't be easily categorized are placed in the Miscellaneous panel:

    qiProp

    For just two dependency properties, the default behavior may be fine. If your user control has a lot of dependency properties or someone other than yourself will be using this user control, then you should look into categorizing them.

    Using Design-Time Attributes
    To help design tools such as Blend and Visual Studio, the .NET Framework allows you to use design-time attributes. The following MSDN article (http://msdn2.microsoft.com/en-us/library/tk67c2t8.aspx) goes into greater detail, but in a nutshell, you can specify the category and a description for your dependency property. Blend will take care of the rest.

    The general format for a design-time attribute is [Category("Value"), Description("Value")]

    In your  user control's code-behind file, in Visual Studio, find the locations where you declare the CRL wrappers for your dependency properties. Above the declaration, add your design-time attribute. For example, the following is what I declared above my BackgroundColor wrapper:

    infoBubbleBGDP

    I do something similar for my QuickInfo dependency property also. Once you have provided the category/description for each dependency property you are interested in, go back to Blend, rebuild your project, and select the user control whose code you modified in Visual Studio. Look in your property grid. At the very bottom, you will see your custom categories and properties that fall under them.

    In my case, I categorized both of my dependency properties into InfoBubble:

    infoBubbleDP

    If you hover over each dependency property's name, the description value you provided will display:

    summary

    Conclusion
    As you can see, by using design-time attributes, you have some flexibility over how Blend will behave when faced with a dependency property that it doesn't know how to categorize. Beyond design-time attributes, there are many other classes of attributes that various developments tools such as Blend and Visual Studio listen for, so be sure to look into them and see if they can help you out.

    Cheers!
    Kirupa =)

  • Expression Blend and Design

    Deep Zoom Composer Released!

    • 26 Comments

    Hi everyone,
    To coincide with the official launch of Expression Studio 3, we have released the first final version of Deep Zoom Composer as well. You can download it from the below location:


    dzcicon Download Deep Zoom Composer

    As always, please uninstall all existing versions of Deep Zoom Composer before installing the new version.

    What’s New
    This release pulls together a lot of the ideas that we had been previewing to you in bits and pieces for the past releases – some for over a year! The following sections describe a few of them in some detail.

    Easily Create Interactive Deep Zoom Experiences
    The Deep Zoom technology in Silverlight can be used to do a lot more than just allowing you to zoom in on high resolution images. Deep Zoom Composer makes it possible for you to create, without writing a single line of code, interactive content involving slideshows, inline navigation, web links, tooltips, and more.

    slideshows

    In our latest release, we really tied a lot of the loose ends together to create something that makes it really easy for you import your images and quickly add some of the functionality described earlier. You can learn more about some of these features by reading Janete’s blog posts on these features: Slideshow Support, Creating Menus, and Adding Links.

    Analytics Tracking
    This release of Deep Zoom Composer enhances the support for analytics tracking we exposed in our earlier release. Specify tracking URLs that will silently get called when you zoom in on an image or region. Don’t worry, we made all of this fairly customizable:

    impressionProfie

    Expect to see us blog more about this feature really soon.

    Improved DeepZoomPix Player
    The enhanced player Deep Zoom Composer uses has been ported over to the online DeepZoomPix service. You can now upload your Deep Zoom creations and view/share them with others while maintaining any interactivity you may have added to your images.

    Below is a simple example of a Windows 7 wallpaper slideshow uploaded to DeepZoomPix directly from Deep Zoom Composer. Click on the image to see the example live on the DeepZoomPix site:

    dzc_images 

    Go Further (Easily) with your Exported Content
    With this release, we made it extremely easy for you to go from having a Deep Zoom composition to something you can edit in Expression Blend or Visual Studio. Based on a lot of your feedback, we expanded our default list of templates to include more templates that contain source files:

    export_templates

    The templates with source files range from ones that do everything for you such as our Behaviors and Classic templates, but one of our templates is nothing more than an empty project containing just a simple Silverlight Application + WebSite containing just your exported images.

    To learn a bit more about our new exporting features, check out Kirupa’s two blog posts on this topic: Extensible Templates in Deep Zoom Composer and Improved Collection Support in Deep Zoom Composer

    Revamped UI
    One of the first things you may notice by looking at Deep Zoom Composer is the more refined look:

    newUI

    We took quite a number of design cues from the work our excellent designer on Expression Blend, Billy Chow did. We hope these subtle UI changes make it easier (and possibly more fun!) for you to work with your content.

    Online Documentation
    To make it easier for us to provide you with direct access to more frequently updated content, we have decided to point users to our online documentation which can be found here. The documentation on our new features has not been published yet, but it will soon. In the interim, you have the links to blog posts we have written posted above.

    Support for Smooth Streaming
    Smooth Streaming is an extension available to IIS web servers where you can easily stream content using adaptive streaming. Deep Zoom Composer now allows you to export your images into a form that is optimized for use on servers enabled with the smooth streaming technology:

    smoothStreamingSupport 


    We will continue to blog more about some of these new features, so keep watching this blog for original content or links to content on either of our blogs.

    A Big Thanks to You All
    It wouldn’t be fair to conclude this post without saying how grateful we are to all of you who have provided us with feedback and requests on things you would like to see. You all rock.

    Of course, Deep Zoom Composer also wouldn’t be possible without the talented work of some brilliant colleagues spread out across Microsoft’s Israel Innovation Labs, Seadragon, and DeepZoomPix teams:

    aboutDialog

    See you all in our blog comments or on our forums.

    Cheers!
    Kirupa & Janete

  • Expression Blend and Design

    Creating a Vista Style Button Template Tutorial

    • 4 Comments

    A new tutorial by Rick Engle shows you how to create a Vista-style button template using Expression Design. Be sure to check it out by clicking here!

  • Expression Blend and Design

    Simulating Sample Data in Blend 2 SP1

    • 7 Comments

    Using sample data can make designing your Silverlight 2 applications more predictable. Given some data, you have a lot of flexibility in designing around this data in Expression Blend. The challenge is that there are are many cases where you simply won’t be able to see your data on the design surface. Think of an example where some data is displayed only after you query a web service. One way around this would be to hard-code the data to display. The problem is that this leaves you with extra work in the end to make sure you switch out your hard-coded data with real data.

    In this post, I will show you some code for a workaround where you can have sample data on the design surface while still retaining your ability to have live data when you are testing your actual app in the browser:

    public class Member
    {
          public string FullName { get; set; }
          public double Delta { get; set; }
          public int Status { get; set; }
    }
    
    public class MyData
    {
          public ObservableCollection Members { get; private set; }
    
          public MyData()
          {
                this.Members = new ObservableCollection();
                
                bool designTime = (System.Windows.Browser.HtmlPage.IsEnabled == false);
                if (designTime)
                {
                      this.LoadDesignTimeData();
                }
                else
                {
                      // TODO: runtime
                }
          }
    
          private void LoadDesignTimeData()
          {
                this.Members.Add(new Member() { FullName = "Bunda3", 
    Delta = -2.39,
    Status = 0 }); this.Members.Add(new Member() { FullName = "SneakerHead",
    Delta = 14.92,
    Status = 1 }); this.Members.Add(new Member() { FullName = "NobodyMan",
    Delta = -4.62,
    Status = 3 }); } }

    The corresponding XAML will look like the following:

     <UserControl.Resources>
          <DesignTimeData:MyData x:Key="MyDataDS" d:IsDataSource="True"/>
                <DataTemplate x:Key="MembersTemplate">
                <StackPanel>
                      <TextBlock Text="{Binding Path=Delta}"/>
                      <TextBlock Text="{Binding Path=FullName}"/>
                      <TextBlock Text="{Binding Path=Status}"/>
                </StackPanel>
          </DataTemplate>
    </UserControl.Resources>
     
    <Grid Background="White">
          <ListBox ItemTemplate="{StaticResource MembersTemplate}" 
          ItemsSource="{Binding Mode=OneWay, 
                        Path=Members, 
                        Source={StaticResource MyDataDS}}"/>
    </Grid>

    The code I have pasted above should be pretty self-explanatory. What I am doing is checking to see if I am currently editing this XAML file in Expression Blend. For Silverlight, you can do that by checking your HtmlPage.IsEnabled boolean property.

    If I am currently in Expression Blend, I pull in data from my sample data class, MyData. This allows me to edit my data template and style my data easily. When I preview this application in the browser, because HtmlPage.IsEnabled will be set to true, you will not see the sample data. Instead, you would see real data!

    - Evgeny

  • Expression Blend and Design

    Deep Zoom Composer has been Updated: Documentation and Bug Fixes!

    • 12 Comments

    Yesterday, we released another update to Deep Zoom Composer, and you can download it from the following location:


    dzcicon Download Deep Zoom Composer

    NOTE: Please uninstall any older versions of Deep Zoom Composer prior to installing this new version.

    This release was really about fixing the bugs that many of you have found as well as addressing some major shortcomings in the app. One of the biggest shortcomings was the lack of comprehensive and updated documentation….until now!

    Updated Documentation
    Thanks to some great work by Chris Lohr and his team, Deep Zoom Composer has some really informative (and nifty-looking) documentation in the form of a User Guide:

    dzc_userGuide2 

    The User Guide covers topics ranging from what Deep Zoom is to how to actually use Deep Zoom Composer to create your own content.

    You can access the User Guide inside Deep Zoom Composer by going to Help | User Guide or by pressing F1.

    Random Trivia
    The photographs used as examples inside the user guide were taken by Chris himself.

    Improved Memory Handling
    One of the areas we have made and continue to make investments in is memory usage. Dealing with many high-resolution images on an interactive design surface is a challenge, but Deep Zoom Composer should now allow you to compose more images than you could in the past. We aren’t quite there yet, so expect future releases to address them in greater detail.

    Improved Project Support
    For the past few releases, we made some major changes to our project structure and how the DZPRJ files are written and opened. Unfortunately, for some of you, those changes meant your older projects were no longer opening. We have tried to fix as many of those incompatibilities in this release, and a big thanks to all of you who have have e-mailed us your projects for testing.

    If you find that your projects are still not opening, we apologize. To help us out, do e-mail your .dzprj files to kirupac[at]microsoft.com to aid in troubleshooting.

    Updated Seadragon Ajax Templates
    In our previous release, you got to use Deep Zoom Composer to export your content to Seadragon Ajax. The approach that was used then was to have you upload the JS libraries along with your images to the server. That was a bit messy. In this release, we are deferring all JS downloading to the Live Labs team’s seadragon.com server itself, so you will no longer have to upload a large quantity of JS files.

    Numerous Little Fixes
    Besides the major changes listed above, we made many little tweaks that are too many to publish and list here. Some of them are bigger such as using an updated version of DeepZoomTools.dll, and some of them are less big like the numerous wording and string changes made.

    If you have any questions or comments, feel free to comment below or post on our forums :)

    Cheers!
    Janete, Kirupa

  • Expression Blend and Design

    How to Animate a Drawing Line

    • 11 Comments

    In Blend you use the Pen tool to draw lines and they appear in the XAML as <Path> elements. But after you’ve drawn your lines and you test your application, the Paths appear immediately: they don’t replay the gestures you used to create them. But sometimes that’s the effect you want, so how do you do that?
    The manual way is only practical if you have very few points. First draw out a Path consisting of straight segments. Then create a new Storyboard, move the playhead forward a tenth of a second and, using the Direct Selection tool, move the last point to the same position as the second-to-last point. Move the playhead again and repeat, each time moving an increasing number of points back to the previous position. When all your points are at the same position as the very first point, move the playhead to time 0 and click the Record Keyframe button. Now reverse the Storyboard and you’re done.

    Any more than a very small number of points and you’ll need an automatic way of generating the Storyboard. You can do that with the code in the assembly dll built from the PathScribbler project I’ve provided below:


    folderfiles Download PathScribbler Project Files

    PathScribbler works with WPF paths but you could easily port the code to work with Silverlight. After building the dll and referencing it in your project, the way you use it is you first draw your Path (which may contain curved segments but they will be straightened by the PathScribbler code) and then you create a new, empty Storyboard. Finally just call PathScribbler.Generate() and pass the name of the Storyboard into which the animations are to be generated along with some other optional parameters. Then you can trigger your Storyboard any way you wish.

    The PathScribbler project is contained in an example project named PencilWriter attached to the post. For this project I made a TextBlock into a Path and I trigger my Storyboard when the main window is clicked. Build and run the project then click the window and wait a moment until the animation is generated and then begins. Hope you have fun with PathScribbler!

    -Steve

  • Expression Blend and Design

    Expression Studio 3 LAUNCHED TODAY!

    • 5 Comments
    US_Prd_Bx_Tilt_L_Expression_Studio_3 Today we announced the official launch of Expression® Studio 3, a suite of professional design tools for creating Rich Internet Applications. This announcement comes shortly after the July 10th Silverlight 3 launch and the availability of the release candidate for Expression Blend 3 + SketchFlow. It is super exciting for us on the Expression Web, Expression Design, Expression Blend + SketchFlow, and Expression Encoder teams to showcase the final versions for the 3rd release of the Studio. Below are various links to the trials, blog posts and other info from the Expression Studio 3 site, community site,  team blogs, and forums. Stay tuned for upcoming related blog posts! 

     
        Expression Studio 3 Overview Video 
        The Visual Kitchen Video 
        Soma’s blog about Silverlight 3
        Download the Expression Studio 3 60 day trial!

     

    Expression Web 3 Expression Web 3
    Microsoft Expression Web 3 gives you the tools you need – PHP, HTML/XHTML, CSS, JavaScript, ASP.NET, ASP.NET AJAX, visual diagnostics and sophisticated CSS design capability – to produce high-quality, standards-based Web sites. Includes SuperPreview.

    Useful Links:
    Expression Web 3 Overview + Video + 60 day trial
    Expression Web Community Site
    Expression Web Forums

    Blog Posts:
    Expression Web Blog
    Soma’s Expression Web 3 blog post
    Blog posts on the xWeb blog related to SuperPreview


    Expression Blend 3

    Expression Blend 3 + SketchFlow

    Microsoft Expression Blend 3 revolutionizes the speed and efficiency with which you can take your ideas from initial concept to completed project on the Silverlight and .NET platforms. Includes SketchFlow.


    Expression Design 3

    Expression Design 3

    Microsoft Expression Design 3 is the perfect companion to Expression Blend or Expression Web. Create sophisticated assets with their fidelity maintained throughout the entire designer-developer workflow.


    Expression Encoder 3  

    Expression Encoder 3
    With Microsoft Expression Encoder, you can import and encode video files, produce live webcasts, enhance media with watermarks and advertising, and publish with Microsoft Silverlight.

    Useful Links:
    Expression Encoder Overview + Video + 60 day trial
    Expression Encoder Community Site
    Expression Encoder Forums

    Blog Posts:
    Expression Encoder Blog
    What’s new in Expression Encoder 3 blog post by the Encoder Team

    Cheers!
    The Expression Blend Team

  • Expression Blend and Design

    PDC 2008 Session – Microsoft Expression Blend: Tips and Tricks

    • 4 Comments

    If you were unable to attend the PDC this year, don’t worry! Because all of the sessions have been recorded and posted online for you to view at your leisure, you won’t miss out on much. One session that my be of particular interest to you is Pete Blois’s and Doug Olson’s talk about Expression Blend:

    exprblend

    You can view the talk online by clicking the following link: http://channel9.msdn.com/pdc2008/PC47/

    The above link also contains downloadable versions of the video along with the PowerPoint slide deck Pete and Doug used to give their talk.

    Pete and Celso’s Twitter App
    A part of the session focused on how a designer can have a large impact on the look and feel of an application without having to write a lot of code or interfering with the core logic of the application. To highlight this, Pete showed off a Silverlight 2-based Twitter app that he wrote originally:

    peteVersion

    Celso Gomes, one of the designers on our team, took Pete’s application and decided to style it to look as follows:

    celsoVersion

    The functionality is the same, but the way the application looks is vastly different. The static screenshots don’t do Celso’s version justice. If you watch the session, you will see subtle transitions and rollover effects that are pretty cool and give the application a more polished feel.

    To try out this Twitter application for yourself, download the source files below:


    folderfiles Download Twitter Source

    You can use Expression Blend 2 SP1 and Visual Studio 2008 to dive into the app and see how Celso and Pete designed and developed the application.

    Cheers!
    Kirupa

  • Expression Blend and Design

    Deep Zoom Composer - June 2009 Preview!

    • 28 Comments

    We know you’ve been waiting, and we know you just can’t wait any longer, so here it is:


    dzcicon Download Deep Zoom Composer

    As always, please uninstall all existing versions of Deep Zoom Composer before installing the new version.

    A few months ago, we asked you what you all wanted to see in Deep Zoom Composer, and a lot of you gave some really great ideas. The following sections highlight just a small list of the new features we’ve added and improved based on your ideas, and our subsequent blog posts will delve into these features in greater detail.

    Navigation Support
    A common request has been around doing more with your Deep Zoom images than just being able to zoom in and out on them. In this release, we have introduced some cool navigation features which allow you to navigate between images or areas of images in a web/hyperlink-like fashion. You can also link images to external URLs as well.

    Better Memory Usage
    Deep Zoom Composer now uses significantly less memory than it did before, so you should now be able to work with more images in your composition.

    First Draft of Updated Collection Exporting
    We have now added the ability for you to import images, tag them directly from your image list in the Compose view, pick from a set of pre-defined templates, and export. All of this was done without you having to first place your image on the design surface.

    This is an area we are going to significantly improve in our upcoming releases, so stay tuned for some further updates on what we have planned.

    Reporting
    If you are an advertiser, knowing which images get the most attention is pretty valuable. We have put in place some early functionality that allows you to do this.

    ...and More!
    There are numerous little improvements we have made, and we’ll try to mention them as we go along in future Deep Zoom Composer related posting.

    Where Next?
    A lot of the features we have introduced are a bit rough on the edges, and we are going to be investing heavily the UI/styling/usability of them for our upcoming releases. Please feel free to comment below on things you like or don’t like, and that will help us prioritize things for future releases.

    Deep Zoom Composer is a collaborative effort of various groups at Microsoft, and for this release, we would like to give a HUGE thanks to the team at Microsoft Innovation Labs in Israel who contributed to making all of the above features possible for this release.

    Enjoy!
    Janete & Kirupa

  • Expression Blend and Design

    Collection of Expression Blend Learning Resources

    • 4 Comments

    This post will try to showcase an updated list of useful (and free!) training material available for Expression Blend:

    Training Resources from Microsoft

    Expression Blend and Design Blog: Tips & Tricks

    Expression Community

    Expression Blend (Online) User Guide

    Expression Blend Tutorials


    MIX 07/08 Video Sessions

    Building Rich Client Experiences with Blend and WPF (by Celso Gomes and Christian Schormann)

    Building Rich Web Experiences (by Celso Gomes)

    Applications = Designers + Developers (by Celso Gomes and Kirupa Chinnathambi)

    Designing Next Generation User Experiences (Johnathan Lansing)


    Tutorials (Videos)

    A Lap Around Microsoft Expression Blend (Steve White)

    4 Visual State Manager Videos (Steve White)

    Animation and Media (Peter Blois)

    Blend for Programmers (Jesse Liberty)

    contentpresenter.com - WPF Video Tutorials (Lee Brimelow)

    Lynda.com - Video Tutorials 1, Video Tutorials 2 (Lee Brimelow)


    Tutorials (Articles)

    Nibbles Tutorials (Celso Gomes)

    Collection of Visual State Manager (VSM) Resources (Steve White)

    Electric Beach (Christian Schormann)

    kirupa.com - Blend + WPF, Blend + Silverlight (Kirupa Chinnathambi)

     

    If there is some useful resource you would like to see added to the list, please drop me an e-mail at kirupac[at]microsoft.com to let me know!

    Cheers!
    Kirupa :)

  • Expression Blend and Design

    Simple Cartoon Animation using Visual States

    • 4 Comments

    One of the goals of Silverlight’s Visual State Manager technology is to let you do quite a bit of control customization without needing to use Blend’s Timeline, nor even having to know what a Storyboard is! Feel free to test-drive the Silverlight Button below, and then read on for a run-down of how easily it can be built.

    Get Microsoft Silverlight

    I started out with some vectors (Paths) depicting the face in its normal resting state. Then I used the Tools > Make Into Control command to make the artwork into a template applied to an actual Button. After deleting the ContentPresenter from the template, I selected the MouseOver state in the States pane, so that the changes I was about to make to the existing elements (to produce a face that looks alert and ready) would be recorded only in the MouseOver state. I moved the head and the features upward a little, and the rest of the changes involved using the Direct Selection tool to move Path points around.

    Because I wanted the Pressed state to be a variation on the MouseOver state, I used the Tools > Copy State To command to duplicate all my changes into the Pressed State. Then, with the Pressed state selected, I adjusted one eye and the mouth to make the wink.

    For the Disabled state I decided I needed new graphics instead of adjusting properties of the existing graphics. So I created a simplified grayscale version of the face and made that version opaque only in the Disabled state.

    For transition timing, I created a number of transitions to and from various states and set their durations to taste.

    Finally, so that each Button instance can customize some aspect of the template, I used template bindings so that Brush colors used in the template to draw various pieces of the face are bound to properties of the Button instance. So for example I selected shoulders, then selected Fill in the property inspector, and then clicked Advanced property options > Template Binding > Background. So now, by setting a value for Background, Foreground, BorderBrush and OpacityMask, a Button instance with this style set on it can determine the colors of the shoulders, face, hair, eyes and nose.

    You can download the sample project files here.

    Steve

  • Expression Blend and Design

    Debugging Design-Time Exceptions

    • 10 Comments

    It’s not entirely uncommon for projects that run fine to not work when loaded into Blend for editing:

    image001

    There are a variety of issues that can cause this- some are bugs that we’re working to address, others are things that need to be fixed by the application developer. Unfortunately designability doesn’t always come free.

    The exception information that’s displayed often has some useful information, but for complex projects I can save some guessing by just debugging through it using VS. This post will describe some steps to help you out.

    Steps to Debug Exceptions on the Design Surface in Blend

    1. Open the project with the error in Blend, but close the XAML file which contains the error.
       
    2. Open the same project in Visual Studio.
       
    3. Attach the VS debugger to the Blend process:
      1. In Visual Studio, go to Debug->Attach to Process.
         
      1. Select Blend.exe from the Available Processes list:

     image003

      1. Ensure that the “Attach To:” field reads ‘Managed Code’, if not, click Select… and change it to “Managed Code”

    attachManageCode

      1. Click Attach
         
    1. Set Visual Studio to break on all exceptions:
      1. In Visual Studio, go to Debug->Exceptions…
         
      2. Ensure there’s a checkbox beside Common Language Runtime Exceptions:

     image008

      1. Click “OK” 
         
    1. Go back to Blend, and open up the XAML file containing the error.
    2. What ideally will happen is that you’ll get a nice stack trace leading to some of your code in Visual Studio and the cause is readily apparent:

    image009

    Common Examples of Errors We See
    Let’s look at some common errors we often encounter with Silverlight 2 projects:

    Common Error
    Accessing the web page while in the design surface, such as the above example. Anything related to HtmlPage is off-limits when in design time since the app is not being hosted in a web page:

    if (HtmlPage.IsEnabled) {
       
    HtmlPage.Window.Alert("Hello World!");
    }

    Common Error
    Accessing isolated storage in the design surface, or even accessing a method which contains a call to isolated storage. When hosted at design-time the Silverlight application is actually running on the desktop .NET runtime where these APIs do not exist. This means that methods which contain a call to isolated storage cannot be called even if the isolated storage is never accessed.

    Bad:

    public Page() {
       
    InitializeComponent();

       
    if (HtmlPage.IsEnabled) {
           
    using (Stream s =
                          IsolatedStorageFile.GetUserStoreForApplication()
                                             .CreateFile("testdata")) {
           
    }
    }

    Good:

    public Page() {
            InitializeComponent();
     
        if (HtmlPage.IsEnabled)
            this.InitializeData();
    }

    public void InitializeData() {
           using (Stream s = IsolatedStorageFile.GetUserStoreForApplication()
                                                .CreateFile("testdata")) {
           }
    }

    Bonus Trick
    One of the other complaints that I’ve heard frequently is that debugging templates errors in Silverlight 2 Beta 2 is not so easy. Too often you just get a stack trace with a bunch of nonsense calls to Measure or MeasureOverride. To help debug these errors in my own projects I’ve started overriding MeasureOverride in my own controls so that they’ll appear in the stack trace as well. This way when a template fails to load, I can quickly tell where it was in the application.

    protected override Size MeasureOverride(Size availableSize) {
        
    return base.MeasureOverride(availableSize);
    }

    Hope this helps!

    - Pete Blois

  • Expression Blend and Design

    Expression Design -- New name, new UI

    • 2 Comments

    Expression Design is a vector based graphics design tool that is part of Expression Studio.   It is targeted at graphic designers who need to build visual assets for new WPF (Windows Presentation Foundation) applications.  The goal of Exrpession Design is to bring artists into the process of building great user experiences.   We've been getting feedback on CTPs for a while now under the codenames of Acrylic and Expression Graphic Designer.  Now we have a shiny new name and a brand new interface.

    New UI

    Back in 2005, we released a preview of Acrylic, a graphics design program based off the venerable vector tool Creature House Expression.  As the months passed, we realized that the UI just wasn’t clicking with our audience.  The whole Expression suite is about bringing elegant and beautiful design to the process of application development.   So why not create a UI that embodied our team’s core principles?

    After many moons (and numerous late night dinners by our rock star team), we now have a stylish UI running in WPF on top of our C++ artboard.  Stylistically, the UI matches Expression Blend so you’ll be comfortable in both applications.  For now it comes in a soulful dark gray, but there is also a light theme in the works for all those folks that like a dash of sunshine in their lives. We still have quite a bit of polishing to do, but the foundation is in place.   This is mad scientist stuff.  I like working with mad scientists.

    Designers on the team

    I’m a big believer that a good product is a collection of a lot of little things done right. This only happens when you ask good questions and get a ton of rapid feedback from your actual users.   Taking this feedback philosophy to the extreme, we hired some very talented graphic designers to be part of our team.  They slogged through our daily builds and attended the feature design meetings.   When stupid decisions were made, they yelled.  Along the way, the programmers listened and fixed hundreds of subtle workflow issues.    

    Expression Design has a long life ahead of it and we wanted designers to be part of the development process (and culture!) from the very beginning.

    All those little improvements

    This release has dozens of small workflow improvements that add up to a much nicer experience.  You can find the big list here:http://www.microsoft.com/products/expression/en/expression-design/free-trial-faq.mspx

    Here are some of my personal favorites.  

    ·         Fewer palettes: I’m constantly switching between various applications, which means inevitable resizing of the app. I must admit I tend to get a bit retentive when it comes to keeping my palettes so I waste a surprising amount of time lining the half dozen palettes straight again.  With fewer palettes that you can dock with a click of a button, this isn’t an issue any longer.

    ·         The color dropper on the color palette:  When you select this color dropper you can pick a color anywhere on the screen, even if it is outside the current application.  Quite the time saver.

    ·         Pen tool:  The Bezier pen tool is a subtle instrument.  Most designers I know play the modifier keys like a piano when they are drawing vector shapes.  Half the time, when you ask “What steps are you performing?” they honestly can’t say.  It is all muscle memory stored up from years in the pit of production.  But if you put change how the tool works, it is immediately obvious.  The feel is wrong.  We spent a lot of time getting the feel of our pen tool right.

    ·         Updated XAML exporter:  This is really the heart of why you would use Expression Design right now.  It is currently the best way to get complex graphics into Expression Blend.  

    You can grab the December CTP of Expression Design here: http://www.microsoft.com/products/expression/en/expression-design/free-trial.mspx 

    Take care
    Danc.

  • Expression Blend and Design

    Expression Studio 4 Launches

    • 17 Comments

    Today at Internet Week in NYC, we announced the availability of Expression Studio 4. You can download the trial of Expression Studio 4 Ultimate that includes Expression Blend 4 and SketchFlow by clicking below:


    s4 Expression Studio 4 Ultimate

    Keep watching this blog for more news, updates, and in-depth looks at some of the new features that we’ve introduced. Until then, here are some related links:

    1. Microsoft Expression home page
    2. Christian Schormann’s blog
    3. Soma’s Favorite Expression Studio 4 Features

    Note that if you are currently doing Windows Phone development, please do not upgrade to the final version of Expression Blend 4 yet. We will release an updated version of all of our phone components in the future, so please continue using Expression Blend 4 RC.

    Of course, no major release would be possible without the feedback all of you have provided, so thank you!

    - Expression Blend Team

  • Expression Blend and Design

    Expression Blend 4 Release Candidate Available!

    • 5 Comments

    Recently, the final versions of both Silverlight 4 and .NET 4 have been released! To coincide with this, we are releasing a release candidate version of Expression Blend 4 that you can use to target them:

    Download everything you need below:


    .NET Framework 4
    blendicon_3 Expression Blend 4 Release Candidate

    There are two things that you really need to know about this release.

    First, if you are doing Windows Phone development, you should not use the Expression Blend 4 RC. We will have an update for you soon with updated components, but in the meantime, please use Expression Blend 4 Beta.

    Second, this release of Expression Blend 4 targets the final versions of Silverlight 4 and .NET 4, you can share your creations with the rest of the world. You no longer are limited to only sharing your creations in source code form or for private testing.

    As always, we love to hear from you. Please feel free to comment below or use our forums here.

    - The Expression Blend Team

  • Expression Blend and Design

    Holiday Savings – Add Expression Blend 2 to Your Design Tool Set

    • 10 Comments

    Hi everyone. The following post is written by Renee Yong, Marketing Manager for Expression. I hope you find the content interesting!
    -- Kirupa


    blend50

    For a limited time, customers in the United States can shop the Microsoft Online Store for Microsoft Expression Blend,  Expression Studio and Expression Web and get 50% off.

    Chances are good that you qualify for the Upgrade pricing if you have any existing web design or creative software, or Microsoft Office software, including any ONE of the following:

    • A licensed copy of an earlier version of Expression Web
    • Adobe Creative Suite (any version)
    • Adobe/Macromedia Flash or Director (any version)
    • Adobe/Macromedia Dreamweaver (any version)
    • Adobe GoLive (any version)
    • Microsoft Office (any version)
    • Microsoft FrontPage (any version)
    • Quark QuarkXPress (any version)

    [Note: Pricing and specials are set on a locale-by-locale basis.  This deal applies only to US customers of the Microsoft Online Store and is valid only for a limited time.]

  • Expression Blend and Design

    Keyframe easing and key splines

    • 4 Comments

    An animation authored in Blend contains keyframes. The animation defines which element/property to affect and each keyframe defines a key time at which a value should be in effect. The process of animating the property values between successive key times is called interpolation.

    Let’s say you’re translating an element from the top of a Grid to the bottom to represent a falling motion. With the element at the top of the screen you drop a keyframe at time 0. Then you move the playhead to time 1 and drag the element to the bottom of the screen. The interpolation between the two screen positions will be linear by default: the element will appear to fall at a steady rate.

    If you want the motion to resemble a real-world falling object then you want the element’s speed to be slow at the beginning and gradually speed up towards the end. This kind of interpolation is known as ease out because the element’s position is easing out of its original value on its way to the new value. Similarly there exists an ease in type of interpolation which can either be used alone or combined with ease out. To apply full ease out to the animation you right-click the first keyframe and click Ease Out > 100%.

    If you want more control over interpolation then we need to talk about key splines and you’ll need to tweak some XAML. If you followed along with the ease in walkthrough above then switch to XAML view and find the storyboard which contains your animations and key frames. There are two animations: one targeting TranslateTransform.X and one targeting TranslateTransform.Y. Take a look at the key frames in the Y animation. The second keyframe has a KeySpline attribute which is a string containing the coordinates of a pair of points – let’s call them x1,y1 and x2,y2 respectively. The secret to understanding and controlling keyframe interpolation lies with these coordinates and what they represent.

    In the sense of the KeySpline attribute, a spline is a curve of value over time (drawn between implied coordinates of 0,0 and 1,1) whose shape is defined by two control points. The KeySpline attribute contains those control points. If you’ve drawn curves with Blend’s Pen tool then you may know such control points as tangents. When you omit the KeySpline attribute, its control points default to the coordinates 0,0 and 1,1. Here’s a visualization of the resulting key spline:

    When the control points (shown in red) coincide with the start and end points of the curve, as they do by default, the curve is actually a straight line. This is why, unless you explicitly set ease in or ease out, Blend will give linear interpolation between keyframes. The unit square key spline is scaled to the actual value and time deltas of the keyframe which defines it. Here’s what the key spline looks like when ease out is set to 100%:

    The first control point (x1,y1) has moved to 0.5,0. If you now set the ease in value of the second keyframe to 100%, the second control point (x2,y2) moves to 0.5,1 and the resulting visualization looks like this:

    To be clear, the KeySpline values x1,y1,x2,y2 for keyframe n correspond to ease out for keyframe n-1 (first control point: x1,y1) and ease in for keyframe n (second control point: x2,y2) respectively. This means that, for a handoff animation, you can still define an ease out for the non-existent keyframe at time 0. When you first build the animation, drop a keyframe at time 0; then right-click it to set ease out; then delete it. The ease out value will be safely stored in the x1,y1 values of the second keyframe’s KeySpline.

    The control point coordinates can be set to any pair of double values between 0 and 1. In this example the first control point is at 0.1,0.5 and the second control point is at 0.8,0.33:

    Try this key spline out in your application. Replace the contents of the KeySpline attribute on the second keyframe with the control point coordinate string “0.1,0.5,0.8,0.33”. Build and run and see if the resulting motion matches the graph. Remember that the graph is showing an increase in the property which is being animated. In this case the property is TranslateTransform.Y and Y increases down the screen in WPF.

    In fact, the control points for a given curve are identical whether the value is increasing or decreasing. But it’s easier to imagine them on a graph with the value axis flipped (so the origin moves to the top-left and positive y is downwards). Here’s an example where the value of keyframe n is less than the value of keyframe n-1 but y1 and y2 have the same positive values as the previous example:

    You can use Blend’s Pen tool to draw graphs like the ones shown. If you want more complex value curves than the ones shown here then just draw more segments. Adjust the control points (tangents) so that the interpolation curve between each value is how you want it. Then imagine (or draw) the dotted unit square around each pair of values and use it to call off the control point coordinates in the range 0,0 to 1,1 and build a KeySpline string from them. It’s important that your control points don’t fall outside the dotted rectangle. For a value curve, control point coordinates outside the valid range mean either that the curve has a turning point (a keyframe value is missing) or that time is decreasing somewhere on the curve.

    In the next post I’ll share a tool, based on Blend, that you can use to generate double animations from a set of value curves (drawn with the Pen tool) and parameter objects.

     

  • Expression Blend and Design

    Creating and Editing Gradients in Expression Blend 3 Preview

    • 6 Comments

    One of our goals for Expression Blend 3 is to provide better tools and user experience for visual designers. At a high level, we prioritized features that allow the designer to keep their focus on the artboard more often. This translated into an improved selection model, predictable layout, familiar and efficient keyboard shortcuts and a flexible and powerful gradient editing experience. This blog post is the first in a series that will highlight features and improvements targeted to the visual designer. Let’s start with the new gradient editing tools. The UI is subject to change for the final release but this overview should give you an idea of the features available in the Preview.

    GradientToolUI

    For Blend 3 we have separated out the Brush Transform tool into two different tools, Gradient and Brush Transform. The Gradient tool allows you to create and edit the properties of linear (LinearGradientBrush) and radial (RadialGradientBrush) gradients on the artboard. The Brush Transform tool allows you to transform any brush type by modifying the translation, rotation, scale and skew. These values are stored as a part of the RelativeTransform property on the brush. Separating out these tools gives you greater control and predictability of which properties are edited, creates cleaner XAML, and makes it easier to animate and bind gradient properties.

    All you have to do to create a gradient is select the Gradient tool in the Toolbar or press the ‘G’ keyboard shortcut and click and drag to define the start and end points.  This creates a gradient for the selected object and sets start and end point to the same positions that you clicked and released the mouse.

    The Gradient tool adorner shows the start point, end point, individual stops and the selected stop. Now you can use the adorners to edit the start (StartPoint) and end (EndPoint) of the gradient by rotating and dragging the adorner. To add a new stop press Alt and click anywhere on the line (Note: In the final release you will not have to press Alt, just click and release). To change the position of a gradient stop (Offset) just click and drag it along the line. To remove a gradient stop click and drag it off the line. To edit the color just double click on the stop and a color picker is displayed where you can select a color for the stop.

    ColorPopup

    Another really useful feature for editing gradients is the Gradient eyedropper. This is located in the color editor in the Brushes panel when you have an object with a gradient selected.

    GradientEyedropperUI

    Just select the Gradient eyedropper and click and drag anywhere inside or outside of Blend to grab a gradient.  For example, if I have a picture displayed in my browser with a nice gradient I can easily apply this gradient to my shape using the Gradient eyedropper by clicking and dragging:

    selecting_my_gradient

    Once the gradient has been selected, you will notice that your selected element in Blend now features the range of colors you selected earlier:

    selected_gradient

    The range of colors I picked in the above example was pretty simple, so you are able to see the four gradient stops and the colors they represent. For more complicated source images, you may have stops that are located close to each other. To adjust these stops, just zoom in to create more visual space between the stops on the artboard so that it is easier to select and edit them.

    Closing Tips
    By using the Gradient eyedropper, it can be easy to get some pretty complex gradients. Have you ever wondered how to reset the gradient back to the black to white default?  Blend uses the gradient from the object that was last selected. 

    1. Set your object to No brush in the Brushes panel.
    2. Select none by clicking on an empty area of the artboard or pressing Ctrl + Shift + A.
    3. Select your object and then select the Gradient brush tab.

    There are also a few additions in the Brushes panel that will help you create and edit gradients.

    • Use the Offset editor to specify a value numerically.
    • Reverse the order of your gradient stops with the Reverse gradient stops button.
    • Select the previous or next gradient stop using the gradient stop iterator. This is useful for selecting stops when you have two stops with the same or very similar values.
    • Hover over a stop to get a tooltip of its offset and color value.

    Finally, there is also an Advanced properties section for the Brushes panel that includes other brush properties like MappingMode, SpreadMethod and RelativeTransform:

    brushesPanel2

    Well, that’s the overview of the new gradient editing features in Expression Blend 3 Preview! I hope you find it easier to work with gradients.

    Joanna

  • Expression Blend and Design

    Windows Phone Developer Tools Beta Released

    • 5 Comments

    It’s been a while since we released an update for those of you working on Windows Phone 7 projects! Well, wait no more! Today we’ve released an updated version of Expression Blend that supports all of the latest changes made to the Windows Phone 7 runtime along with some cool new features.

    First, download everything you need below:


    blendicon_3 Windows Phone Developer Tools (Beta)

    As you can see, you no longer need to download and install Expression Blend separately. You can just run the single Windows Phone Developer Tools installer and get Windows Phone variants of Expression Blend, XNA Game Studio, and Visual Studio for free.

    Note
    This version of Expression Blend installs and runs side-by-side with Expression Blend 4 and only supports working with Windows Phone projects.

    New Features
    As mentioned earlier, beyond supporting the changes made to the runtime since the last release, we’ve added a lot of new functionality that makes designing Windows Phone 7 applications easier. Some of the more notable features are described below.

    Improved Design Time Previewing
    Because your applications can be viewed in different orientations, themes, and accent colors, we’ve made it easier for you to visualize within Expression Blend what your application would look like.

    All of this functionality is exposed via the improved Device panel:

    image

    The Device Panel now provides you with easy access to preview between Landscape and Portrait orientations, Light and Dark themes, and Accent color.

    For example, here is a preview of what your application looks like in the default Dark theme:

    image

    Clicking the Light theme button in the Device panel swaps out all of the dark theme resources to display the light theme variants of them:

    image

    This allows you to design and make sure that your applications look the way you want regardless of which light/dark mode the user has their phone in.

    Preview Text Styles
    Windows Phone 7 applications emphasize consistent use of text as a key design element. To make it easier for you to preview and apply existing text styles, we’ve added the ability to preview inline what a particular text style would look like:

    image

     

    Initial Application Bar Design Experience
    One of the unique and differentiating features found in Windows Phone 7 when compared to Silverlight and WPF is the Application Bar:

    image

    In this release, we have exposed a very early preview of our support for allowing you to design the Application Bar. You have the ability to create an Application Bar, add Application Bar Buttons, and add Application Bar Menu Items. Because Application Bar Buttons display a 48x48 PNG icon, you can specify your own icon or pick from a collection of icons we have provided for you:

    image

    A future blog post will go over in greater detail how to use what you have today to design a working Application Bar!

    Easier Page Navigation
    Because Windows Phone applications are very page centric, we decided to make navigating between pages easy. To navigate from one page to another, we exposed a Navigate To context menu:

    image

    This menu can be accessed when you right click on any element that you wish to start the navigation when clicked.

    Updated FluidMoveBehavior
    We have revised the FluidMoveBehavior to be on par with the improvements we made for Silverlight 4 and .NET 4. You can learn more about what this means by reading Kenny Young’s blog post on this topic.

    Optimizing the On-screen Keyboard
    Unlike Silverlight and WPF where a full keyboard for input is almost always guaranteed, Windows Phone users may not have that luxury when working on their phones. While a on-screen keyboard is available, given the size of the screen, having the full keyboard with all of the keys appear on-screen may not be ideal for all situations either. It may be helpful to users if the keys displayed were optimized for the type of information they would be entering at that particular moment.

    To address that need, we improved our support for the InputScope property on TextBox that allows you to specify what kind of data will be entered:

    image

    For example, if Number was selected for the InputScope on a TextBox, here is what the on-screen keyboard looks like when you focus on it on the emulator/device:

    image

    Notice that you are not seeing the traditional full keyboard. Instead, you are seeing a keyboard optimized only for numerical input.


    As always, if you have any questions or feedback, please feel free to comment below or post on our forums.

    Thanks,
    Expression Blend Team

  • Expression Blend and Design

    Silverlight Control Styling Tips Articles

    • 7 Comments

    We’ve published eleven new articles on the blog and they all contain information and tips that you’ll find useful when styling common Silverlight 3 controls. First there’s an article with some general tips: it discusses template binding, different ways of binding Content in your template, some of the smarts in the Make Into Control command, and some tips on visual states. Then there are ten articles focusing on specific commonly-used controls. For each of these specific articles the article format includes a list of the control’s visual states and parts, an explanation of the function and importance of each part, a graphical comp of a control and its states, a XAML representation of the control in artwork form, and then in-depth steps for turning that artwork into a template for the control. Here are links to the articles. Enjoy!

    - Steve

  • Expression Blend and Design

    Samples and Tutorials for Expression Blend have been updated to match the Release Candidate!

    • 1 Comments

    The Samples and Tutorials for Expression Blend have been updated with the following changes:

    • The samples and tutorials now reflect the Release Candidate (RC) build of Expression Blend. 
    • Additional sources of tutorials and samples were added to the bottom of Samples and Tutorials Gallery - Expression Blend.
    • Each of the tutorials appears much longer than they were before because they have been edited to include more details for each step to help you understand where you might use the information again.
    • The Fabrikam Fast Track tutorial was removed because it is very similar to Fabrikam Catalog Part 2 - Control Templates.
    • The Welcome Screen tutorial and sample were removed because they do not reflect the new Welcome Screen in Expression Blend.

    Thank you.

  • Expression Blend and Design

    Deep Zoom Composer Example (Updated)

    • 15 Comments

    Hi everyone,
    I have posted a quick ZIP file containing a sample project that shows you how to use the output from the Deep Zoom Composer with Silverlight's MultiScaleImage control.


    zipIcons Download Sample (Zip)

    Beyond giving you a working example, this implementation also includes a C# approach to getting mousewheel support in IE, Firefox, and Safari (Mac). You can read more about my mouse wheel support on my blog here.

    For another example using the keyboard, please read Mike Taulty's post on this topic.

    Update: Scott Hanselman has posted a modified version of this code with panning, click-to-zoom, and more! Check it out here.

    - Pete

  • Expression Blend and Design

    Check Out The New Pattern (XAML+CS) Library!

    • 1 Comments

    Creating great looking and functioning applications is tough. It requires having a good eye for design, but it also requires some technical knowledge about how to make the design functional.

    As you can probably guess, it is our goal to help you use Expression Blend, Visual Studio, and our related tools to create those great applications. We spend a great deal of time adding new features and making existing features better to help you do just that. Making improvements to the applications is only one side of how we try to help you create great applications, however.

    The other side involves helping you better understand how to actually create great applications, and we try our best to provide some valuable training resources. Some notable shoutouts include the .toolbox and the Expression Community sites. While looking at videos or reading tutorials is useful, we wanted to go further and also provide you with a library of xaml+code samples that showcase something small, something specific, something cool. We felt that, in many cases, simply being able to deconstruct how something was done can be equally (if not more useful) in learning how to do something.

    This library of xaml+code snippets, known better by its friends and family as the Pattern Library, lives as an extension to the Expression Gallery:

    visualPatternLibrary

    You can learn more about the Pattern Library by reading Lars Power’s newsletter article introducing it.

    Please feel free to download and play with the patterns. If there is something you feel is missing, please feel to let us know or just create it yourself and upload it.

    Cheers,
    Kirupa =)

  • Expression Blend and Design

    Try to Define Visuals in XAML

    • 6 Comments

    Ok, pop-quiz time. Below, you will find two screenshots I took from two different applications:

    ss1

    [ Screenshot 1 ]

    ss2

    [ Screenshot 2 ]

    Can you tell what is different between those two images? If you said that the button in the second image seems a few pixels off from the image on the top (or something similar), you are wrong. The UI depicted in both of the screenshots is exactly the same. Yes, it was a trick question.

    While both applications look almost the same when run, let’s look at both of these applications when opened in Blend. Here is what the application depicted in Screenshot 1 looks like:

    blend1

    The application depicted in Screenshot 2 looks as follows:

    blend2

    As you can tell, there is a major discrepancy between the first and second screenshot when viewed in Blend. More specifically, the second version of the application seems to be missing some UI and the button is not styled at all.

    What Happened?
    The source of the discrepancies have to do with what Blend actually shows on the design surface. By and large, Blend is a XAML editor. Anything defined in XAML, we will do our best to display it on our design surface. For visuals defined in your code-behind files, you may not always be able to see them in Blend.

    This is where the differences between the two apps stems from. In the first app, everything was defined in XAML. In the second app, some of the visuals were defined in XAML, but a many of the visuals were not. That is why Blend is only showing an incomplete subset of what your application actually looks like when you view it on the design surface. This is a problem.

    Why is this a problem?
    The word “problem” may be a harsh word for this, but the outcome is less than ideal if your application is a collaborative effort between someone technical and someone less technical. If you are a developer, being able to visualize code and make changes may be straightforward. If you are more design oriented, looking at code to define the look and feel of an application is not natural. You would prefer something that looks like the application depicted in Screenshot 1 where everything is exposed in Blend’s design surface and you can make changes visually without writing code.

    Some Solutions
    The first and obvious answer that I have is to have you resist the temptation to add controls, define layout, or perform other visual tasks using code. The reason is that, as you saw in the screenshot of the second application, Blend’s design surface won’t be able to help you out.

    Of course, there are many cases where such an extreme solution will not work. It is common for many applications to fall into a gray area where visuals are partly defined in XAML and partly defined in code. Fortunately, there are some simple steps you can take to make designers more productive while still giving developers the flexibility to develop the application.

    Use UserControls
    If you have visual content that needs to be added programmatically, make sure that content is defined as UserControls. The reason is that you can define the UserControl and make changes entirely within Blend. Programmatically, you can add this UserControl – which may have been edited inside Blend – to your application without sacrificing the designability of the UserControl itself.

    Create Styles in XAML, Apply them Programmatically
    Sometimes, UserControls may be a bit excessive. For example, in the second screenshot, I have a button that is unstyled:

    styledButtons

    Instead of having a dedicated UserControl to wrap your styled button, you could just define the style in Blend and programmatically apply the style. Let’s say you have a style called GreenButtonStyle defined in your Resources panel:

    gbstyle

    To apply this style to your button, use the following code:

    greenButton.Style = this.Resources["GreenButtonStyle"] as Style;

    This allows you to still define the look and feel of your Button using Blend, but its application is handled entirely via code.

    Conclusion
    Hopefully this post helped give you some ideas on how to ensure the visuals of your application have the ability to be modified by Blend. I didn’t enumerate all of the various cases, but if there is something clever that you do to enable developers and designers to work together, please comment below.

    Cheers!
    Kirupa :-)

Page 3 of 9 (217 items) 12345»