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.
- 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.”
- 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.
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:
- Are public and have a default public or internal constructor or are internal and have either a default public or internal constructor
- Types deriving from Window or Page are ignored
- FrameworkElements in other .exe projects are ignored
- Internal classes will only be displayed when the active designer is for an item in the same project
- 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