Click here to Skip to main content
15,890,512 members
Articles / Desktop Programming / WPF

New Options for Visual Studio 2010 Beta2 WPF and Silverlight Projects

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
30 Oct 2009CPOL2 min read 15.3K   2   4
New Options for Visual Studio 2010 Beta2 WPF and Silverlight Projects

ToolOptions

To get to this Options dialog, use the Tools menu, select Options, select Text Editors, select XAML, select Miscellaneous.

MarkupExtension IntelliSense and Editing

The most requested feature for the WPF & Silverlight XAML Editor was MarkupExtension IntelliSense. This feature has been added to Visual Studio 2010 Beta2.

In addition to IntelliSense, you also get some entry helpers.

  1. When you type a { (left curly brace) Visual Studio will automatically insert the } (right curly brace) for you.

    You can disable this feature by un-checking the above option, “Closing braces for MarkupExtensions.”

  2. When you press the SPACEBAR inside {} (curly braces) Visual Studio will automatically insert a comma for you to the left of the space added by pressing the SPACEBAR.

    You can disable this feature by un-checking the above option, “Commas to separate MarkupExtension parameters.”

Toolbox Auto-Population

Visual Studio 2010 Beta2 now adds all Custom Controls and UserControls in the Solution to the Toolbox when you build the solution. Controls are added to a separate Toolbox tab for each project.

You can disable this feature by un-checking the above option, “Automatically populate toolbox items.”

How Auto-Population Works

When you build a project, its corresponding tab in the Toolbox is cleared and then all types that derive from FrameworkElement are added to the Toolbox tab for that project. (See Fine Print below for more details.)

When you build the solution, all projects Toolbox tabs are updated as explained above.

If you want to prevent an item from appearing in the Toolbox during the Auto-Population processing, decorate the class with the System.ComponentModel.DesignTimeVisible attribute and pass False in the constructor.

The following code snippet shows the DesignTimeVisible attribute decorating the CustomView UserControl. The CustomView UserControl will not appear in the Toolbox.

VB.NET
Imports System.ComponentModel

<DesignTimeVisible(False)>
Public Class CustomerView
    Inherits UserControl

End Class

Fine Print

To appear in the Auto-Population Toolbox process a type must derive from FrameworkElement and:

  1. Are public and have a default public or internal constructor or are internal and have either a default public or internal constructor
  2. Types deriving from Window or Page are ignored
  3. FrameworkElements in other .exe projects are ignored
  4. Internal classes will only be displayed when the active designer is for an item in the same project
  5. Friend Assemblies are not taken into account for Toolbox Auto-Population

Close

Have a great day.

Just a grain of sand on the world's beaches.

Posted in CodeProject, Silverlight, VB.NET, Visual Studio 2010, WPF Controls, WPF General

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions

 
Questionwill there be regions in XAML? Pin
christoph brändle1-Nov-09 1:01
christoph brändle1-Nov-09 1:01 
AnswerRe: will there be regions in XAML? Pin
User 2710091-Nov-09 15:01
User 2710091-Nov-09 15:01 
GeneralRe: will there be regions in XAML? Pin
gmagana20-Jan-10 12:00
gmagana20-Jan-10 12:00 
GeneralRe: will there be regions in XAML? Pin
User 27100921-Jan-10 1:27
User 27100921-Jan-10 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.