<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotneteers.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>Dotneteers.net</title><link>http://dotneteers.net/blogs/</link><description>All for .net, .net for all!</description><dc:language>en-US</dc:language><generator>CommunityServer 2008 (Build: 30417.1769)</generator><item><title>A Designer-friendly Approach to MVVM</title><link>http://dotneteers.net/blogs/vbandi/archive/2010/03/12/a-designer-friendly-approach-to-mvvm.aspx</link><pubDate>Fri, 12 Mar 2010 14:54:08 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1971</guid><dc:creator>vbandi</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;My new article, “&lt;a href="http://www.silverlightshow.net/items/A-Designer-friendly-Approach-to-MVVM-Part-I.aspx" target="_blank"&gt;A Designer-friendly Approach to MVVM&lt;/a&gt;” is up at Silverlight Show. Here is the intro:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;“If you work with Silverlight or WPF, you have probably met the phrase “MVVM”. Almost everyone who is anyone in the WPF / Silverlight scene has their own MVVM framework, and their own way of explaining and teaching MVVM. Scary terms like IoC, Dependency Injection, Commanding Frameworks, Event Aggregators, Unit Testing, etc just roll off the tongue of the MVVM experts. This is one of the reasons why MVVM is intimidating for a lot of people. Still, you can create perfectly valid MVVM applications without even knowing what those terms mean. This post will show you my approach to MVVM, which is hopefully simple enough to get you started.”&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;So, head over to Silverlight Show, and let me know what you think!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1971" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category></item><item><title>Part 2 of my Blend Screencast Series is Online</title><link>http://dotneteers.net/blogs/vbandi/archive/2010/03/05/part-2-of-my-blend-screencast-series-is-online.aspx</link><pubDate>Fri, 05 Mar 2010 17:07:02 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1935</guid><dc:creator>vbandi</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;The second part of my screencast series “Transforming an Ugly Duckling into a Graceful Swan With Expression Blend and Silverlight - Part 2 Intro Animation” is now online at SilverlightShow.net. In this part, I am going to add some bling to the app – namely the Intro animation, the ability to skip it, and to replay it. The Intro animation itself is not created with Silverlight, so I will just use it as a video. This part takes heavy use of Visual States, Behaviors and Easings.&lt;/p&gt;  &lt;p&gt;To see the article and the associated screencast, go to &lt;a href="http://www.silverlightshow.net/items/Transforming-an-Ugly-Duckling-into-a-Graceful-Swan-With-Expression-Blend-and-Silverlight-ndash-Part-2-ndash-Intro-Animation.aspx" target="_blank"&gt;SilverlightShow.Net&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1935" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/User+Experience/default.aspx">User Experience</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Expression+Blend/default.aspx">Expression Blend</category></item><item><title>VS 2010 Package Development – Chapter 1: Visual Studio Packages</title><link>http://dotneteers.net/blogs/divedeeper/archive/2010/03/02/visual-studio-packages.aspx</link><pubDate>Tue, 02 Mar 2010 12:13:03 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1926</guid><dc:creator>inovak</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I have spent a lot of time with preparing a book about Visual Studio Extensibility, focusing on Visual Studio Package Development. I have made proposals for several book publishers, but I did not manage to get a contract, most of them found such a book is not profitable. I decided to share the four chapters of the book that I’ve already written. They are the followings:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Chapter 1: Visual Studio Packages &lt;/li&gt;    &lt;li&gt;Chapter 2: Commands, Menus and Toolbars &lt;/li&gt;    &lt;li&gt;Chapter 3: Window Management and Tool Windows &lt;/li&gt;    &lt;li&gt;Chapter 4: Services &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I hope, you will find these chapters useful.&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;The majority of Visual Studio’s functions you use in your everyday work (such as programming languages, editors, designers and debuggers) are provided by Visual Studio Integration Packages, or shortly by packages. Some call them VSIP packages but the VSIP acronym is overloaded: while the first two letters means “Visual Studio” the last two may mean either “Integration Package” or “Industry Partner” and unfortunately both terms are frequently used. To avoid ambiguity hereinafter you’ll meet the term package or VSPackage.&lt;/p&gt;  &lt;p&gt;Developing packages means you can extend Visual Studio on the same way as its developer team at Microsoft. Adding new functions through packages is actually programming a new part of Visual Studio just like if you were the member of the team. You can use the full power and integrate any functionality you miss from the IDE!&lt;/p&gt;  &lt;p&gt;In this chapter you will create a very simple package called FirstLook to get a feeling that first steps are easy. Then you’ll learn the basic concepts behind packages and dive into the FirstLook project’s structure and source code to have a closer look at the implementation of those concepts. At the end of this chapter you’ll be familiar with the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Building a package with the VSPackage Wizard &lt;/li&gt;    &lt;li&gt;The idea of a package &lt;/li&gt;    &lt;li&gt;The on-demand package loading mechanism and the idea of package siting &lt;/li&gt;    &lt;li&gt;Registration of packages and information stored in the registry &lt;/li&gt;    &lt;li&gt;The Visual Studio Experimental Hive and using it for debugging packages &lt;/li&gt;    &lt;li&gt;The package build process &lt;/li&gt;    &lt;li&gt;Deploying VSPackages &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This chapter will not teach you how to build a specific functionality into a package and does not cover the API used to develop packages. The focus is on understanding the concepts, architectural considerations behind VSPackages to let you take a look behind the scenes and get acquainted with package mechanisms. These concepts will be very useful when you are about creating your own packages.&lt;/p&gt;  &lt;h2&gt;Building a Simple Package&lt;/h2&gt;  &lt;p&gt;There are a few important concepts to understand if you want to develop a package. In order treat them in the right context you build a very simple functional package to touch the surface of those concepts and then jump into the details.&lt;/p&gt;  &lt;p&gt;A Visual Studio package is a class library containing the types responsible for the package infrastructure and functionality. In order Visual Studio recognize the compiled class library as package, encapsulated types should have specific metadata information and some additional steps are required after compilation. So, even if you could start building a package from an empty class library, it is much easier to use the VSPackage Wizard installed with Visual Studio SDK.&lt;/p&gt;  &lt;p&gt;Start a new project with the File|New|Project command. The IDE displays the &lt;strong&gt;New File&lt;/strong&gt; dialog to select the desired project type. You can find the Visual Studio Integration Package project type under the Other Project Types category in the Extensibility folder as Figure 1 illustrates.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0301_5F00_68B89CC3.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0301" border="0" alt="f0301" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0301_5F00_thumb_5F00_28828349.png" width="660" height="363" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 1&lt;/strong&gt;: &lt;em&gt;The New Project dialog with the Extensibility project types&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Should you not find this project type or many other project types in the Extensibility folder means that Visual Studio SDK is not — or not properly — installed on your machine. Install it according to the setup notes in order to go on with building the package.&lt;/p&gt;  &lt;p&gt;Give the &lt;strong&gt;FirstLook&lt;/strong&gt; name to the package in order to be able to follow code details later in this chapter. Clicking the OK button starts the Visual Studio Integration Package Wizard (henceforward VSPackage Wizard is used, it is shorter) which welcomes you with the dialog in Figure 2.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0302_5F00_0BFEB9E8.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0302" border="0" alt="f0302" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0302_5F00_thumb_5F00_04DF7D70.png" width="536" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 2&lt;/strong&gt;: &lt;em&gt;The Welcome page of the VSPackage Wizard&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Click the Next button to go on specifying the package parameters and you get to the Select a Programming Language page of the wizard as Figure 3 shows.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0303_5F00_7DC040F7.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0303" border="0" alt="f0303" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0303_5F00_thumb_5F00_0B9286F3.png" width="536" height="414" /&gt;&lt;/a&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 3&lt;/strong&gt;: &lt;em&gt;VSPackage Wizard lets you select the programming language&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;As it was mentioned earlier you create the code in C#. Packages are strongly named assemblies, so you need to sign the class library assembly with a key. For this project the wizard creates the signing key. Click Next and you get to the Basic VSPackage Information page as Figure 4 shows.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0304_5F00_5685F7C2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0304" border="0" alt="f0304" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0304_5F00_thumb_5F00_7D540E02.png" width="536" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 4&lt;/strong&gt;: &lt;em&gt;The wizard asks for the basic package information&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The information you provide here will be used in the source code generated for the package and will be displayed in the Visual Studio About dialog. The Company name will be used in the namespace of generated types as well as VSPackage name which also names the class representing the package in code. VSPackage version is additional information to give a way for distinguishing separate package releases.&lt;/p&gt;  &lt;p&gt;Text typed in the Detailed information field will be displayed in the About dialog and can supply the user with more information about what the package does.&lt;/p&gt;  &lt;p&gt;When you click the Next button the wizard moves you to the VSPackage Options page — as can be seen in Figure 5 — to set a few more code generation options.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0305_5F00_0B2653FE.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0305" border="0" alt="f0305" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0305_5F00_thumb_5F00_6B0B4740.png" width="536" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 5&lt;/strong&gt;: &lt;em&gt;You can select a few code generation options&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In this sample you are going to create only a menu command that pops up a message on the screen, so set the Menu Command option. Should you select the other two options the VSPackage Wizard would create some more code for a simple tool window or a rich text editor. Please, let those options remain unchecked. With the Next button the wizard goes to the page where we can specify a few details about the menu command to create. This page is shown in Figure 6.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0306_5F00_0D432898.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0306" border="0" alt="f0306" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0306_5F00_thumb_5F00_34113ED8.png" width="536" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 6&lt;/strong&gt;: &lt;em&gt;Command options are specified here&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The command will be added to the Tools menu of Visual Studio, in Command name you can specify the text to be displayed for the menu item. According to the internal command handling architecture each command has an identifier. The Command ID field supplies a name for this identifier and VSPackage Wizard will generate an ID value behind this name. With clicking Next the wizard moves to the Test Project Options page as shown in Figure 7.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0307_5F00_6A2EB371.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0307" border="0" alt="f0307" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0307_5F00_thumb_5F00_10FCC9B2.png" width="536" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 7&lt;/strong&gt;: &lt;em&gt;VSPackage Wizard asks for test project options&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The wizard can create unit test for the package which check if its functional units work properly. The wizard also can create an integration test project for you, in which packages are tested within the context of a Visual Studio instance.&lt;/p&gt;  &lt;p&gt;For the sake of simplicity here you do not create any tests, so clear the options — by default both are checked. Now you have set all parameters the wizard uses to generate the package project, click on the Finish button.&lt;/p&gt;  &lt;p&gt;In a few seconds the wizard generates the package project ready to build and run. Taste the pudding you have just cooked! With the Build ð Rebuild Solution function you can compile the package and carry out all other steps required to run the package with Visual Studio. So rebuild the project and start with Ctrl + F5 (Debug|Start Without Debugging).&lt;/p&gt;  &lt;p&gt;You might be surprised as a new instance of Visual Studio is started with “Experimental Instance” in its window caption.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: If this is the first time you have started the Experimental Instance, the Choose Default Environment Settings dialog appears just like when you first time launch Visual Studio after installation.&lt;/p&gt;  &lt;p&gt;This is an instance of Visual Studio that hosts the &lt;strong&gt;FirstLook&lt;/strong&gt; package — later you’re going to learn the concept behind. The menu command implemented by this freshly generated package can be seen in the Tools menu as Figure 8 shows it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0308_5F00_5BF03A81.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0308" border="0" alt="f0308" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0308_5F00_thumb_5F00_3BD52DC4.png" width="368" height="136" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 8&lt;/strong&gt;: &lt;em&gt;The menu command item appears in the Tools menu&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;When you click the Simple Message command, it pops up a message box telling you it was displayed from the &lt;strong&gt;FirstLook&lt;/strong&gt; package.&lt;/p&gt;  &lt;p&gt;The package also registered some branding information that can be seen in the Help|About dialog as Figure 9 shows.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0309_5F00_1BBA2107.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0309" border="0" alt="f0309" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0309_5F00_thumb_5F00_747FD7D1.png" width="660" height="498" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 9&lt;/strong&gt;: &lt;em&gt;Branding information of the &lt;strong&gt;FirstLook&lt;/strong&gt; package&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Nothing call tell more about your VSPackage than its source code. But before deep-diving into it, let’s treat important concepts about packages.&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc234410284"&gt;&lt;/a&gt;&lt;a name="_Toc224959878"&gt;&lt;/a&gt;Concepts behind Visual Studio Packages&lt;/h2&gt;  &lt;p&gt;A VSPackage is the principal architectural unit of Visual Studio. As you already know, Visual Studio IDE itself is the Shell hosting a set of VSPackages working together with each other and with the Shell. The basic responsibility of a package is to provide a common container for extensibility objects. So, a VSPackage is a software module that is a unit not only from architectural point of view but also from deployment, security and licensing aspects.&lt;/p&gt;  &lt;p&gt;Developers — including the developers of Visual Studio — create VSPackages to provide some extension to the VS IDE and group them into modules according to their functionality. These extensions can be:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Services&lt;/strong&gt;. These are software objects that offer functionality for other objects in the same package or even for other packages. For example, the C# Language Service (as its name also tells) is a service. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;User interface elements&lt;/strong&gt;. Menus, toolbars, and windows can be used by developers to initiate some actions in the user interface, interact with, display messages, information and figures, and so on. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Editors&lt;/strong&gt;. During development you write and modify program text to create applications. This task is the responsibility of an editor. Visual Studio 2010 has its own core text editor and you can extend it or even create your own editors. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Designers&lt;/strong&gt;. Application creation is not just simply a text-typing activity. There are many visual tools known as designers that allow an alternative representation and design of modules, components, parts or even full applications. Well-known examples are the Windows Forms designer, The WPF Forms designer, the ASP.NET page designer or the Data Table designer. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Projects&lt;/strong&gt;. When developing applications you generally work with a large number of files. A project is an organization of source files and resources. A project not just simply stores these files but also defines operations with them, allows building, debugging and deploying the products created from source files. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;It is natural in .NET that you can divide your functional units into separate assemblies where consumer assemblies will reference other service assemblies. The same principle works for VSPackages: an assembly containing a package can reference other assemblies that may contain not just helper types but even extensibility object types.&lt;/p&gt;  &lt;p&gt;An assembly — as the smallest physical deployment unit in .NET — may contain more than one VSPackage. Although generally only one package is encapsulated in an assembly, you may have many reasons to group more packages in one assembly — including deployment considerations.&lt;/p&gt;  &lt;h3&gt;The Package Load Key&lt;/h3&gt;  &lt;p&gt;The previous versions of Visual Studio checked the package before loading them into the process space of the Shell. Any VSPackage should have been “sealed” with a so-called Package Load Key (PLK) and this key was verified during package load time. PLK was not a digital signature or a full hash, because it was calculated from a few information fields in the package. PLK could have been requested from Microsoft through a webpage: the developer specified a few well-defined attributes of the package and some logic calculated the PLK value. This value was embedded as a resource into the assembly representing the package.&lt;/p&gt;  &lt;p&gt;Every time the package was loaded, the Shell checked the PLK against the package attributes it had been created from. Should have been this check fail, the Shell would have refused loading the package. This PLK mechanism did not mean that a developer had to request a new PLK for each package modification. While no basic information the PLK had been generated from was changed, the package continued to load.&lt;/p&gt;  &lt;p&gt;Although this concept had been seemed useful, in the real life in had no real advantage. To be honest, in most of the cases it was the root cause of deployment issues, in many scenarios it raised more problems than it solved.&lt;/p&gt;  &lt;p&gt;In the new Visual Studio 2010 the Shell does not use the Package Load Key to check packages before loading them into the memory.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410285"&gt;&lt;/a&gt;&lt;a name="_Toc224959880"&gt;&lt;/a&gt;&lt;a name="_Toc223159723"&gt;&lt;/a&gt;On-demand Loading of Packages&lt;/h3&gt;  &lt;p&gt;You can imagine that complex packages like the C#, VB, F# or C++ languages with all of their “accessories” could consume many system resources by terms of memory and CPU. If you do not use them they do not press the CPU, but they might use the memory if they sit within the Visual Studio process space. If you create a project using F# you actually do not need services belonging to other languages, so why to load them into the memory at all?&lt;/p&gt;  &lt;p&gt;The architects of Visual Studio implemented the package load mechanism so that packages are loaded into the memory at the first time when an event requiring the presence of the package is raised. These events can be one of the followings:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Command activation&lt;/strong&gt;. The user (or some running code) activates a menu or toolbar command (or even a command that cannot be accessed from UI) served by a package which has not been loaded yet. It does not matter if the user has clicked on a menu item or the running code has activated it with a “virtual click” the result is the same. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Object or service request&lt;/strong&gt;. The Shell is about to use an object or a service in a package not loaded yet. For example a tool window should be displayed or a service function is about to be executed. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Context change&lt;/strong&gt;. The Shell can enter into certain user interface contexts. For example, when you start debugging a project, the Shell enters into the Debugging context. When a solution with a single project is loaded, the Shell enters into the &lt;strong&gt;SolutionHasSingleProject&lt;/strong&gt; context. You can declare that a package should be loaded as the Shell enters in a certain context. Visual Studio has a few predefined contexts, but you can also define your own ones. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So, if you do not need a package during the whole IDE session, it does not consume the memory at all. Should you click on a menu item activating a command sitting in a package which has not been loaded yet the IDE will immediately load and initialize it. Should you ask for a tool window in a package not in the memory yet, the IDE will start loading it.&lt;/p&gt;  &lt;p&gt;Binding package loading with a context change is generally required where your package want to subscribe for events raised in Visual Studio. You cannot bind the event either to command activation or object or service requests, because in order your package could work you have to subscribe to events. The code to create subscriptions is generally put into the initialization code. But you cannot run any code belonging to a package while it is not loaded into the memory! In this case you declare that the best context (the latest possible) to load the package. If your package logic requires, you can specify the &lt;strong&gt;NoSolutionExists&lt;/strong&gt; context. Visual Studio enters into this context immediately when the Shell is loaded and ready to function, so packages bound to this context load at Visual Studio startup time.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: Be frugal with system resources if you have to load a package at Visual Studio startup time. Allocate only resources that are indispensable to carry out the required initialization at startup time.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410286"&gt;&lt;/a&gt;&lt;a name="_Toc224959881"&gt;&lt;/a&gt;Package Siting&lt;/h3&gt;  &lt;p&gt;When you develop a package it is an independent piece of code. When it is loaded into Visual Studio it becomes an organic part of the IDE:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Your package can access services and objects provided by the Shell and other packages. &lt;/li&gt;    &lt;li&gt;The Shell and other packages can access the objects and services you proffer them. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The process of making a package physically integrated into the Shell is called &lt;i&gt;siting&lt;/i&gt;. While the package is not sited, its functions cannot be used from outside. From the same reason the package can be only partially initialized, because it cannot touch any objects or services through the Shell. As soon as the package gets sited, it is ready to finish its initialization and be fully functional. Siting happens when Visual Studio loads the package.&lt;/p&gt;  &lt;p&gt;The object type representing your package must implement an interface called IVsPackage (you are going to learn details later in this chapter) and must have a default constructor.&lt;/p&gt;  &lt;p&gt;Loading a package contains the following steps:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The Shell creates an instance of the object type representing your package by invoking its default constructor. &lt;/li&gt;    &lt;li&gt;The Shell calls the SetSite method of the object instance — IVsPackage defines this method — and passes a so-called service provider instance which can be used by the package to query objects in order to access services implemented by the Shell or other packages. &lt;/li&gt;    &lt;li&gt;The Shell allows your package to finish its initialization. In the first step during the construction call the service object did not have any contact with the Shell. After siting all initialization steps invoking Shell services can be carried out. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Although siting physically integrates your package functionally with Visual Studio, functional integration may require some additional — and sometimes complex — steps depending on what your package is intended to do.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410287"&gt;&lt;/a&gt;&lt;a name="_Toc224959882"&gt;&lt;/a&gt;Package Registration&lt;/h3&gt;  &lt;p&gt;Visual Studio must keep track of packages in order to load and use them. Of course, the most flexible would be some kind of discovery where the Shell can look around only in the file system to guess out which entities represent packages. The .NET framework supports and intensively uses metadata (attributes) that can represent the information you can use for this purpose. You can even load an assembly so that only the metadata part is read from the file system and put into the memory. Although you can imagine this mechanism could work, it is not used by the Shell in this way.&lt;/p&gt;  &lt;p&gt;The reason is that the roots of Visual Studio go back to the COM era. Packages are COM objects and can be created not only in managed code but also in native code using the Win32 API with any language including C++, Delphi and others. So, not surprisingly Visual Studio uses the registry to keep information about packages.&lt;/p&gt;  &lt;p&gt;Although the registry is used to store configuration information about Visual Studio settings, developers and package users are not bothered with registration issues. The new deployment mechanism (through VSIX files) implemented in Visual Studio 2010 takes away this task. When Visual Studio is started, its discovery mechanism collects the information to be entered into the registry and does all the registration process on the fly. Developers perceive they do installation only by copying files and this resembles to the great mechanism we are using with the .NET Framework.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410288"&gt;&lt;/a&gt;&lt;a name="_Toc224959883"&gt;&lt;/a&gt;Package Information in the Registry&lt;/h3&gt;  &lt;p&gt;Packages are loaded into the memory on-demand. To effectively use this approach, Visual Studio stores the registration information about packages in a way so that this information could be accessed from the direction of objects to be used. For example, one kind of object that could trigger package loading is a tool window. A tool window has its own identity. When it is about to be created in order to be displayed, Visual Studio turns into the registry and addresses the corresponding key with the tool window identity. Under that key there is information stored about the identity of the package owning and implementing the tool window. Using this identity Visual Studio finds the registry key containing the package information and loads the package into the memory accordingly. The identity of packages and objects is represented by a GUID.&lt;/p&gt;  &lt;p&gt;Figure 10 shows a few registry keys that store package-related information for Visual Studio.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0310_5F00_52102F05.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0310" border="0" alt="f0310" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0310_5F00_thumb_5F00_4AF0F28D.png" width="351" height="358" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 10&lt;/strong&gt;: &lt;em&gt;Package and object information in the registry&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Assume that Visual Studio is about to create a service instance. It uses the Services registry key and according to the service identity it finds the package. Figure 11 illustrates the service key of the Class Designer Service. At the left side you can see the subkey named by the GUID identifying the service. At the right side you see the corresponding package ID in the default value under the service key.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0311_5F00_6EE0DBE0.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0311" border="0" alt="f0311" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0311_5F00_thumb_5F00_2EAAC266.png" width="660" height="301" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 11&lt;/strong&gt;: &lt;em&gt;Service information in the registry&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Visual Studio uses the same approach to find owner packages for any other objects.&lt;/p&gt;  &lt;p&gt;There is one important thing to treat about package information in the registry. Packages can add their own user interface items to the Visual Studio IDE in form of menus and toolbars. If this UI information were created during the package initialization time, Visual Studio would need to load the package at startup time in order to present the package-dependent UI to the users. This approach would demolish the whole concept of on-demand loading.&lt;/p&gt;  &lt;p&gt;Instead, the package uses a declarative way to define the user interface that should be displayed in the IDE at startup time. This information is encapsulated into the package assembly as an embedded resource. During the registration process Visual Studio extracts this resource information and merges it with its standard menus. Each user interface element — the commands they represent — is associated with the identity (GUID) of the owner package, so the Shell knows which package to load when a command is activated.&lt;/p&gt;  &lt;h3&gt;Visual Studio Experimental Instance&lt;/h3&gt;  &lt;p&gt;When you started the FirstLook package a new instance of Visual Studio was launched with the “Experimental Instance” text in its caption. What is that Visual Studio instance and how did it get to the computer?&lt;/p&gt;  &lt;p&gt;Visual Studio Experimental Instance is a test bed to run and debug Visual Studio packages during the development and test phase. It is not a new installation of Visual Studio. It is the same &lt;strong&gt;devenv.exe&lt;/strong&gt; file you use normally. But why you need it?&lt;/p&gt;  &lt;p&gt;As it’s been mentioned earlier the package is registered — information is written into the system registry — in order it could integrate with Visual Studio. Every time you build and run a package some information goes into the registry. When you modify the package it might affect also the information in the registry. You can imagine what an unexpected confusion it can lead that you always modify the registry under the Visual Studio instance you actually use to develop and debug a package? What if your package does not work or even worse it prevents Visual Studio start correctly or even causes a crash? How would you fix the pollution of registry?&lt;/p&gt;  &lt;p&gt;That is the point when Visual Studio Experimental Instance comes into the picture. The Experimental Instance is simply another instance of Visual Studio that picks up its settings from a different place — including configuration files and registry keys.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;devenv.exe&lt;/strong&gt; keeps its configuration settings in the system registry in the &lt;strong&gt;CURRENT_USER&lt;/strong&gt; hive under the&lt;strong&gt; Software\Microsoft\VisualStudio\10.0_Config&lt;/strong&gt; key. When Visual Studio runs it reads out the configuration information from these keys by default. With the &lt;strong&gt;/rootsuffix&lt;/strong&gt; command line parameters the root key used by &lt;strong&gt;devenv.exe&lt;/strong&gt; can be changed.&lt;/p&gt;  &lt;p&gt;The VSPackage Wizard sets up the package project so that the &lt;strong&gt;devenv.exe&lt;/strong&gt; uses the &lt;strong&gt;/rootsuffix Exp&lt;/strong&gt; command line parameter when running or debugging the package. By doing it so &lt;strong&gt;devenv.exe&lt;/strong&gt; will use the &lt;strong&gt;Software\Microsoft\VisualStudio\10.0Exp_Config&lt;/strong&gt; registry key under the &lt;strong&gt;CURRENT_USER&lt;/strong&gt; registry hive. So running the package with the Start Debugging (F5) or Start Without Debugging (Ctrl+F5) functions will launch the Visual Studio Experimental Instance using this registry key.&lt;/p&gt;  &lt;p&gt;The build process of a package copies the package binaries and the so-called VSIX manifest information to a well-known location under the current user’s application data folder. When the Experimental Hive starts, it discovers the package in the folder and uses the information found there to enter the package information into the registry key consumed by the Experimental Instance.&lt;/p&gt;  &lt;p&gt;Using the Experimental Instance prevents you polluting the registry of the Visual Studio instance used for the normal development process. However, making mistakes, recompilations and faulty package registrations does not prevent putting junk or leaving orphaned information in the Experimental Instance registry. Making an appropriate cleanup could be very complex and dangerous if you would do it by delving in the registry.&lt;/p&gt;  &lt;p&gt;Cleaning up packages from the Experimental Instance’s registry is quite easy! The Visual Studio SDK installs the &lt;strong&gt;CreateExpInstance.exe&lt;/strong&gt; utility and adds it to the Visual Studio 2010 SDK menu items under the Tools folder with the name “Reset the Microsoft Visual Studio 2010 Experimental Instance”. Running this utility will reset the registry key belonging to the Experimental Hive to the state after the installation of VS SDK.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: If you develop Visual Studio packages you can get into situations several times where your package which worked before seems suddenly stop working. In majority of these cases the cause is the pollution of Visual Studio registry. There can be many orphaned objects in the registry as a result of continuous modification and rebuild of packages, and that can cause problems. If you run in such a situation, reset the Experimental Instance and then build your package with the Rebuild All function of Visual Studio. This procedure often helps.&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc234410290"&gt;&lt;/a&gt;&lt;a name="_Toc224959885"&gt;&lt;/a&gt;Diving into the Package Source Code&lt;/h2&gt;  &lt;p&gt;You have already created a &lt;strong&gt;FirstLook&lt;/strong&gt; project with the VSPackage wizard and by now you have a good overview about the basic concepts behind packages. Now we go into details and look how those concepts and ideas are reflected in the source code.&lt;/p&gt;  &lt;p&gt;When the VSPackage Wizard generated the code according to the parameters we specified on the wizard pages, it made a lot of work at the background. The wizard carried out the following activities:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Generation of a class library project in C#. &lt;/li&gt;    &lt;li&gt;Adding references to this project for the interoperability assemblies required to access Visual Studio functionality. &lt;/li&gt;    &lt;li&gt;Creating resources used by the package and other resources used by the registration process. &lt;/li&gt;    &lt;li&gt;Adding new MSBuild targets to the project to support the build and registration process of the package. &lt;/li&gt;    &lt;li&gt;Generation of types responsible for implementing the package functionality. &lt;/li&gt;    &lt;li&gt;Setting up the debug properties of the project to start Visual Studio Experimental Instance. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Table 1 summarizes the source files in the &lt;strong&gt;FirstLook&lt;/strong&gt; project.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Table 1&lt;/strong&gt;: &lt;em&gt;FirstLook source files generated by the VSPackage wizard&lt;/em&gt;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;&lt;strong&gt;Source File&lt;/strong&gt;&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;source.extension.vsixmanifest&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;This is the so-called VSIX manifest file which plays vital role in the discovery and registration mechanism of Visual Studio extensions. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;FirstLook.vsct&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;The so-called command table file storing the definition of the menus and commands to be merged into the Visual Studio IDE during the registration process.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;FirstLookPackage.cs&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;Class implementing the simple functionality of the package.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;GlobalSupressions.cs&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;Attributes used to suppress messages coming from the static code analysis.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;Guids.cs&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;GUID values used to identify the package and command objects within the package.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;Key.snk&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;Signing key used to generate the strong name for the package assembly.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;PkgCmdID.cs&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;Constants for identifying command values.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;Resources.resx&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;Resource file to store your functional package resources — resources you use according to the functions you implement in the package.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;em&gt;VSPackage.resx&lt;/em&gt;&lt;/td&gt;        &lt;td&gt;Resource file to store package infrastructure resources — those resources which are used by Visual Studio to integrate your package into the IDE.&lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;p&gt;The wizard added several assemblies to the class library project. Table 2 summarizes their roles. Their names start with the &lt;strong&gt;Microsoft.VisualStudio&lt;/strong&gt;, this prefix is omitted in the table for the sake of clarity.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Table 2&lt;/strong&gt;: &lt;em&gt;Interoperability assembly references in the project&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;   &lt;table cellspacing="0" cellpadding="2"&gt;       &lt;tr&gt;         &lt;td&gt;&lt;strong&gt;Source File&lt;/strong&gt;&lt;/td&gt;          &lt;td&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;~.Shell.Interop&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;This assembly defines several hundreds of core interoperability types (interfaces, structures, enumerations, classes, etc.).&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;~.Shell.Interop.8.0, ~.Shell.Interop.9.0 &lt;/em&gt;and&lt;em&gt; ~.Shell.Interop.10.0&lt;/em&gt; &lt;/td&gt;          &lt;td&gt;There are COM types new in VS 2005, VS 2008 and VS 2010 IDEs. The interoperability wrappers of them are defined in these assemblies where the 8.0 suffix is for VS 2005, the 9.0 suffix for VS 2008 while the 10.0 suffix for VS 2010.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;~.Shell.Interop.Immutable.10.0&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;A few abstract and enumeration types used for package registration attributes.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;~.OLE.Interop&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;There are a few hundred of standard OLE types and interfaces. This assembly provides wrapper types for them.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;~.Shell.9.0&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;The core types of the Managed Package Framework. There is a separate version for VS 2008 with the 9.0 suffix. If you work with VS 2008, you should use this assembly.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;~.TextManager.Interop&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;Interoperability assembly with wrapper types to access text editor and text management functionality. Although this assembly is referenced by the project, it is not used in the package you’ve created.&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/p&gt;  &lt;p&gt;All assemblies having Interop in their names contain only proxy type definitions to access the core Visual Studio COM service interface and object types.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410291"&gt;&lt;/a&gt;&lt;a name="_Toc224959886"&gt;&lt;/a&gt;Package Type Definition&lt;/h3&gt;  &lt;p&gt;Now, let’s see the source code of the package! The wizard added many useful comments to the generated source files. In the code extracts listed here those commands are cut out to make the listings shorter and improve the readability of the code. The indentation has also been changed a bit for the same purpose.&lt;/p&gt;  &lt;p&gt;Listing 1 shows the source code of the most important file in our project named FirstLookPackage.cs. This file implements the type representing our package:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Listing 1&lt;/strong&gt;: &lt;em&gt;FirstLookPackage.cs&lt;/em&gt;&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1a61b8d0-d94d-4134-bc59-650501d47e97" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#ddd;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0 0 0 2.5em;padding:0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.ComponentModel.Design;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Diagnostics;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Globalization;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Shell;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Shell.Interop;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;namespace&lt;/span&gt; DeepDiver.FirstLook&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;{&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;[&lt;span style="color:#2b91af;"&gt;PackageRegistration&lt;/span&gt;(UseManagedResourcesOnly = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)]&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;[&lt;span style="color:#2b91af;"&gt;InstalledProductRegistration&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;#110&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;#112&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;, IconResourceID = 400)]&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;[&lt;span style="color:#2b91af;"&gt;ProvideMenuResource&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Menus.ctmenu&amp;quot;&lt;/span&gt;, 1)]&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;[&lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;GuidList&lt;/span&gt;.guidFirstLookPkgString)]&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;sealed&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;FirstLookPackage&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;Package&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;{&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; FirstLookPackage()&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;Trace&lt;/span&gt;.WriteLine(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#2b91af;"&gt;CultureInfo&lt;/span&gt;.CurrentCulture, &lt;span style="color:#a31515;"&gt;&amp;quot;Entering constructor for: {0}&amp;quot;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ToString()));&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Initialize()&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;Trace&lt;/span&gt;.WriteLine(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#2b91af;"&gt;CultureInfo&lt;/span&gt;.CurrentCulture, &lt;span style="color:#a31515;"&gt;&amp;quot;Entering Initialize() of: {0}&amp;quot;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ToString()));&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Initialize();&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// Add our command handlers for menu (commands must exist in the .vsct file)&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;OleMenuCommandService&lt;/span&gt; mcs = GetService(&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;IMenuCommandService&lt;/span&gt;)) &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;OleMenuCommandService&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;null&lt;/span&gt; != mcs)&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// Create the command for the menu item.&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;CommandID&lt;/span&gt; menuCommandID = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;CommandID&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;GuidList&lt;/span&gt;.guidFirstLookCmdSet, (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;)&lt;span style="color:#2b91af;"&gt;PkgCmdIDList&lt;/span&gt;.cmdidShowMyMessage);&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;MenuCommand&lt;/span&gt; menuItem = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;MenuCommand&lt;/span&gt;(MenuItemCallback, menuCommandID);&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;mcs.AddCommand(menuItem);&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; MenuItemCallback(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// Show a Message Box to prove we were here&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;IVsUIShell&lt;/span&gt; uiShell = (&lt;span style="color:#2b91af;"&gt;IVsUIShell&lt;/span&gt;)GetService(&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;SVsUIShell&lt;/span&gt;));&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt; clsid = &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt;.Empty;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; result;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Microsoft.VisualStudio.&lt;span style="color:#2b91af;"&gt;ErrorHandler&lt;/span&gt;.ThrowOnFailure(uiShell.ShowMessageBox(&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;0,&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;ref&lt;/span&gt; clsid,&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#a31515;"&gt;&amp;quot;FirstLook&amp;quot;&lt;/span&gt;,&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#2b91af;"&gt;CultureInfo&lt;/span&gt;.CurrentCulture, &lt;span style="color:#a31515;"&gt;&amp;quot;Inside {0}.MenuItemCallback()&amp;quot;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ToString()),&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty,&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;0,&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;OLEMSGBUTTON&lt;/span&gt;.OLEMSGBUTTON_OK,&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;OLEMSGDEFBUTTON&lt;/span&gt;.OLEMSGDEFBUTTON_FIRST,&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;OLEMSGICON&lt;/span&gt;.OLEMSGICON_INFO,&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// false&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;out&lt;/span&gt; result));&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;}&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;The &lt;strong&gt;FirstLookPackage&lt;/strong&gt; class becomes a working package by inheriting the behavior defined in the Package class of the&lt;strong&gt; Microsoft.VisualStudio.Shell&lt;/strong&gt; namespace and by using the attributes decorating the class definition.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Package&lt;/strong&gt; base class implements the &lt;strong&gt;IVsPackage&lt;/strong&gt; interface that is required by Visual Studio in order to take an object into account as a package. This interface provides a few methods managing the lifecycle of a package and also offers methods to access package related objects like tool windows, options pages, and automation objects. One of the most important of them is the &lt;strong&gt;SetSite&lt;/strong&gt; method having the following signature:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:8568125d-2981-42f0-8816-a4f118af7192" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#fff;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0;padding:0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; SetSite(IServiceProvider psp);&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Visual Studio calls this method immediately after the package has been instantiated by its default constructor. The &lt;strong&gt;psp&lt;/strong&gt; parameter is an instance of &lt;strong&gt;System.IServiceProvider&lt;/strong&gt; and this object is the key in keeping contact between the package and the IDE: any time the package requests a service object from its context—from the IDE—the &lt;strong&gt;psp&lt;/strong&gt; instance is used at the back, however, the implementation of &lt;strong&gt;Package&lt;/strong&gt; hides it from our eyes.&lt;/p&gt;  &lt;p&gt;The overridden &lt;strong&gt;Initialize&lt;/strong&gt; method is called after the package has been successfully sited. This method has to do all the initialization steps that require access to services provided by the Shell or other packages. Should you move this code to the package constructor you would get a &lt;strong&gt;NullReferenceException&lt;/strong&gt; because at that point all attempts to access the Shell would fail as the package is not sited yet and actually has no contact with any shell objects.&lt;/p&gt;  &lt;p&gt;The package constructor should do only inexpensive initialization that you would put normally to a constructor. Any other kind of initialization activities should be put to the overridden &lt;strong&gt;Initialize&lt;/strong&gt; method. If you have some other expensive initialization activity that can be postponed, you should do them right when there’s no more time to delay them.&lt;/p&gt;  &lt;p&gt;In this case the &lt;strong&gt;Initialize&lt;/strong&gt; method binds the single menu command provided by the &lt;strong&gt;FirstLookPackage&lt;/strong&gt; with its event handler method called &lt;strong&gt;MenuItemCallback&lt;/strong&gt;:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1326b578-63c3-458a-9c3a-1586c09f3280" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#ddd;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0 0 0 2.5em;padding:0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Initialize()&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;{&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;Trace&lt;/span&gt;.WriteLine(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#2b91af;"&gt;CultureInfo&lt;/span&gt;.CurrentCulture, &lt;span style="color:#a31515;"&gt;&amp;quot;Entering Initialize() of: {0}&amp;quot;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ToString()));&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Initialize();&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// Add our command handlers for menu (commands must exist in the .vsct file)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;OleMenuCommandService&lt;/span&gt; mcs = GetService(&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;IMenuCommandService&lt;/span&gt;)) &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;OleMenuCommandService&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;null&lt;/span&gt; != mcs)&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;{&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// Create the command for the menu item.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;CommandID&lt;/span&gt; menuCommandID = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;CommandID&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;GuidList&lt;/span&gt;.guidFirstLookCmdSet, (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;)&lt;span style="color:#2b91af;"&gt;PkgCmdIDList&lt;/span&gt;.cmdidShowMyMessage);&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#2b91af;"&gt;MenuCommand&lt;/span&gt; menuItem = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;MenuCommand&lt;/span&gt;(MenuItemCallback, menuCommandID);&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;mcs.AddCommand(menuItem);&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;}&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;First it calls the &lt;strong&gt;Initialize&lt;/strong&gt; method of the base class — &lt;strong&gt;Package&lt;/strong&gt; in this case. Omitting the call to the base implementation would prevent the package running correctly. Look at the call of &lt;strong&gt;GetService&lt;/strong&gt; in Line 7! If you could select a method that is especially very important when creating Visual Studio Extensions, probably the &lt;strong&gt;GetService&lt;/strong&gt; method is that one! This method is implemented by the &lt;strong&gt;Package&lt;/strong&gt; class — many other Managed Package Framework objects also implement this method — in order to request service objects from the environment. &lt;strong&gt;GetService&lt;/strong&gt; has one type parameter — it’s called service address — that retrieves a service object implementing the service interface specified by the address type.&lt;/p&gt;  &lt;p&gt;So, Line 7 obtains an &lt;strong&gt;OleMenuCommandService&lt;/strong&gt; instance that you can use to bind event handlers to so-called command objects. In Line 11 and 12 a &lt;strong&gt;CommandID&lt;/strong&gt; instance is created to address the command to be put to the Tools menu. In Line 12 a &lt;strong&gt;MenuCommand&lt;/strong&gt; instance is created to assigns the &lt;strong&gt;MenuItemCallback&lt;/strong&gt; method as a response for the command specified with the &lt;strong&gt;CommandID&lt;/strong&gt; instance. Line 13 entitles the menu command service to handle events related to the command. The result of this short initialization code is that your package handles the event when the user clicks the Simple Message menu item in the Tools menu by executing the &lt;strong&gt;MenuItemCallback&lt;/strong&gt; method. In the next chapter you will find all nitty-gritty details about the command handling concepts used in Visual Studio and there you will learn much more about the initialization approach used here.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;MenuItemCallback&lt;/strong&gt; method uses the &lt;strong&gt;IVsUIShell&lt;/strong&gt; service to pop up a message box from within the IDE.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410292"&gt;&lt;/a&gt;&lt;a name="_Toc224959887"&gt;&lt;/a&gt;Registration Attributes&lt;/h3&gt;  &lt;p&gt;By now you know that packages are registered with Visual Studio in order to support the on-demand loading mechanism and allow merging menus and toolbars into the user interface of the IDE. The information to be registered is created during the build process from attributes assigned to the package class:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:08e5a3c4-3799-4a1c-8276-2891bc740a5d" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#ddd;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0 0 0 2em;padding:0 0 0 5px;"&gt; &lt;li&gt;[&lt;span style="color:#2b91af;"&gt;PackageRegistration&lt;/span&gt;(UseManagedResourcesOnly = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)]&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;[&lt;span style="color:#2b91af;"&gt;InstalledProductRegistration&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;#110&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;#112&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;, IconResourceID = 400)]&lt;/li&gt; &lt;li&gt;[&lt;span style="color:#2b91af;"&gt;ProvideMenuResource&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Menus.ctmenu&amp;quot;&lt;/span&gt;, 1)]&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;[&lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt;(GuidList.guidFirstLookPkgString)]&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;sealed&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;FirstLookPackage&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;Package&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;{&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#008000;"&gt;// --- Package body omitted&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Packages are COM objects and so they must have a GUID uniquely identifying them. The &lt;strong&gt;Guid&lt;/strong&gt; attribute is used by the .NET framework to assign this GUID value to a type. All attributes above except &lt;strong&gt;Guid&lt;/strong&gt; are derived from the &lt;strong&gt;RegistrationAttribute&lt;/strong&gt; class which is the abstract root class for all attributes taking a role in package registration. Table 3 describes the attributes decorating the &lt;strong&gt;FirstLookPackage&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Table 3&lt;/strong&gt;: &lt;em&gt;Registration attributes in FirstLookPackage&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;   &lt;table cellspacing="0" cellpadding="2"&gt;       &lt;tr&gt;         &lt;td&gt;&lt;strong&gt;Source File&lt;/strong&gt;&lt;/td&gt;          &lt;td&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;PackageRegistration&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;Adding this attribute to a class, the build process will handle it as a package and looks for other attributes to prepare the package registration according to your intention. In the example this attribute sets the &lt;strong&gt;UseManagedResourcesOnly&lt;/strong&gt; flag to tell that all resources used by the package are described in the managed package and not in a satellite DLL.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;InstalledProductRegistration&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;This attribute is responsible to provide information to be displayed in the Help|About dialog in the IDE. The constructor of this attribute requires four arguments with the following meanings:            &lt;ul&gt;             &lt;li&gt;The first and second strings provide the name and the description of the package. The “#” characters indicate that these values should be looked up in the package resources with the IDs following “#”. &lt;/li&gt;              &lt;li&gt;The third “1.0” parameter is the product ID (version number). &lt;/li&gt;              &lt;li&gt;The fourth parameter (&lt;strong&gt;IconResourceID&lt;/strong&gt;) tells which icon to use for the package. &lt;/li&gt;           &lt;/ul&gt; All resources (name, description and icon) should be defined in the VSPackage.resx file. &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;&lt;em&gt;ProvideMenuResource&lt;/em&gt;&lt;/td&gt;          &lt;td&gt;This attribute is to create registry entries about menu and toolbar items provided by the package. Visual Studio uses the embedded resources here to merge the package menus into the Visual Studio menus.            &lt;br /&gt;The attribute has two parameters. The first is the so-called resourceID. This value is set to &lt;strong&gt;Menus.ctmenu&lt;/strong&gt; as during the build process the VSCT compiler uses this value by default when adding the binary representation of the .vsct file to the package resources. The second parameter is called versionID and it plays important role in the caching mechanism of resources. In the next chapter you are going to examine the role of this attribute in details.&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/p&gt;  &lt;p&gt;There are many other registration attribute beside the ones in the table above, later in the book we are going to meet a few of them. You are not constrained to apply only the registration attributes defined by the Managed Package Framework, and you can define your own attributes. Any of them including yours are handled on the same way by the build process as the predefined ones.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410293"&gt;&lt;/a&gt;&lt;a name="_Toc224959888"&gt;&lt;/a&gt;The Command Table&lt;/h3&gt;  &lt;p&gt;The wizard generated a file named &lt;strong&gt;FirstLook.vsct&lt;/strong&gt;. It is an XML file and the file extension refers to the acronym coming from the “Visual Studio Command Table” expression. The schema of the XML file defines the command table owned by the package.&lt;/p&gt;  &lt;p&gt;The command table is transformed into a binary format during the build process and is embedded into the package assembly as a resource. During the registration phase the ID of this resource is put into the registry. When Visual Studio starts, loads this binary resource information and merges it with the menus of the IDE including toolbars and context menus.&lt;/p&gt;  &lt;p&gt;In order to avoid menu merges every time Visual Studio is launched, the IDE uses a cache mechanism and carries out the merge process only once for each package.&lt;/p&gt;  &lt;p&gt;The next chapter will treat this mechanism and the structure of the command table in details. Listing 2 shows you the command table described in the &lt;strong&gt;FirstLook.vsct&lt;/strong&gt; file.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Listing 2&lt;/strong&gt;: &lt;em&gt;FirstLook.vsct&lt;/em&gt;&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:21433d93-3dfa-462f-aa10-9922297239b3" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#ddd;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0 0 0 2.5em;padding:0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515;"&gt;xml&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;version&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;encoding&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;?&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CommandTable&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;xmlns:xs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Extern&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;href&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;stdidcmd.h&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Extern&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;href&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;vsshlids.h&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Extern&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;href&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;msobtnid.h&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Commands&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;package&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidFirstLookPkg&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Groups&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;guid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidFirstLookCmdSet&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;MyMenuGroup&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;priority&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;0x0600&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Parent&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;guid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidSHLMainMenu&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;IDM_VS_MENU_TOOLS&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Groups&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Buttons&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Button&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;guid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidFirstLookCmdSet&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;cmdidShowMyMessage&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;priority&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;0x0100&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;Button&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Parent&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;guid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidFirstLookCmdSet&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;MyMenuGroup&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Icon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;guid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidImages&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPic1&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Strings&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CommandName&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;cmdidShowMyMessage&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CommandName&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ButtonText&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;Simple Message&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ButtonText&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Strings&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Button&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Buttons&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Bitmaps&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Bitmap&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;guid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidImages&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;href&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;Resources&amp;#92;Images_32bit.bmp&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;usedList&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Bitmaps&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Commands&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Symbols&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GuidSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidFirstLookPkg&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color:#0000ff;"&gt;d55758eb-6581-48fe-930b-f3536f43b6f0}&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GuidSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidFirstLookCmdSet&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color:#0000ff;"&gt;05da2180-8d8e-4822-913b-b6a9012c4b2b}&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;MyMenuGroup&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;0x1020&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;cmdidShowMyMessage&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;0x0100&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GuidSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GuidSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;guidImages&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color:#0000ff;"&gt;49ba23b3-1631-483d-a095-003cb157f55d}&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPic1&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPic2&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPicSearch&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;3&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPicX&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;4&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;IDSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;bmpPicArrows&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;5&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GuidSymbol&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Symbols&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CommandTable&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;In this listing all comments placed into the generated file are omitted for saving space. However, it is worth to read those comments to have a better understanding of the command table structure.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;.vsct&lt;/strong&gt; file tells a lot about how Visual Studio is architected, how it solves the coupling of functions (commands) and user interface elements.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Commands (actions to execute) are separated from the user interface element triggering the command. The same command can be assigned to different menus and toolbars; they will use the same action. &lt;/li&gt;    &lt;li&gt;Commands used together can be grouped and simply merged into existing menus by using the command group representation. It is much easier then coupling commands with hosting menus one-by-one. &lt;/li&gt;    &lt;li&gt;Elements are identified by symbols rather than using explicit values. This makes the coupling less error-prone: values of symbols must be defined only once, and the VSCT compiler can check for mistyping. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The root element of a &lt;strong&gt;.vsct&lt;/strong&gt; file is the &lt;strong&gt;CommandTable&lt;/strong&gt; element. As you can see all related elements are defined by the &lt;em&gt;http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable&lt;/em&gt; namespace. No doubt, the most important element is &lt;strong&gt;Commands&lt;/strong&gt;, because this node defines commands, their initial layout and behavior.&lt;/p&gt;  &lt;p&gt;Any command in the VS IDE must belong to the IDE itself or to a package. To assign a command to the appropriate (owning) VSPackage, the package attribute of the &lt;strong&gt;Commands&lt;/strong&gt; element must name the GUID of the corresponding package. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Commands&lt;/strong&gt; node can have a few child elements; each has a very specific role. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Group&lt;/strong&gt; elements define so-called command groups; each of them is a logical set of related commands that visually stand together. In the &lt;strong&gt;FirstLook.vsct&lt;/strong&gt; file we have a &lt;strong&gt;Group&lt;/strong&gt; element that holds only a &lt;strong&gt;Button&lt;/strong&gt;. A button represents a piece of user interface element the user can interact with, in this case a menu item that can be clicked. The &lt;strong&gt;Parent&lt;/strong&gt; element defines the relationship between elements, for example the &lt;strong&gt;Button&lt;/strong&gt; element defined above is parented in the &lt;strong&gt;Group&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;Toolbars and menus would be poor without icons helping the user to associate a small image with the function. The &lt;strong&gt;Bitmap&lt;/strong&gt; nodes allow defining the visual elements (icons) used in menus.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Symbols&lt;/strong&gt; section is a central place in the command table file where you can define the identifiers to be used in the other parts of the&lt;strong&gt; .vsct&lt;/strong&gt; file. You can use the &lt;strong&gt;GuidSymbol&lt;/strong&gt; element to define the “logical container GUID” and the nested &lt;strong&gt;IDSymbol&lt;/strong&gt; elements to provide (optional) identifiers within the logical container. The name and the value attribute of these elements do exactly what you expect: associate the symbol name with its value.&lt;/p&gt;  &lt;p&gt;The VSPackage Wizard put the generated GUID values into the&lt;strong&gt; FirstLook.vsct&lt;/strong&gt; file but they also can be found in the &lt;strong&gt;Guids.cs&lt;/strong&gt; file. The &lt;strong&gt;PkgCmdID.cs &lt;/strong&gt;file defines constant values for the &lt;strong&gt;IDSymbol&lt;/strong&gt; values used by package commands. These three files must be kept consistent, so if you change a GUID or a command identifier, the changes should be tracked in the other files as well; otherwise your package will not work as expected.&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc234410294"&gt;&lt;/a&gt;&lt;a name="_Toc224959889"&gt;&lt;/a&gt;Package Resource Files&lt;/h3&gt;  &lt;p&gt;The &lt;strong&gt;FirstLook&lt;/strong&gt; project has two resource files:&lt;strong&gt; Resources.resx&lt;/strong&gt; and &lt;strong&gt;VSPackage.resx&lt;/strong&gt;. They both utilize the resource handling mechanism in the .NET Framework, but have different roles. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Resources.resx&lt;/strong&gt; is to store functional resources that are consumed by the objects and services of your package. For instance, you can store error messages, prompt strings, UI elements, logos, and so on in this resource file and access them programmatically through the static members of the Resources class generated by the &lt;strong&gt;ResXFileCodeGenerator&lt;/strong&gt; custom tool attached to the &lt;strong&gt;.resx&lt;/strong&gt; file.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;VSPackage.resx&lt;/strong&gt; can store resources just like &lt;strong&gt;Resources.resx&lt;/strong&gt;, but its primary role is to embed package infrastructure resources. This resource file does not use the &lt;strong&gt;ResXFileCodeGenerator&lt;/strong&gt; custom tool and so does not generate any helper class to access resources. &lt;/p&gt;  &lt;p&gt;As you remember the package is decorated with the &lt;strong&gt;InstalledProductRegistration&lt;/strong&gt; attribute which refers to resource identifiers 110, 112 and 400:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3d6dd13c-923c-4c22-b6b4-8eb2c7aaf3ef" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#fff;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0;padding:0 0 0 5px;"&gt; &lt;li&gt;[&lt;span style="color:#2b91af;"&gt;InstalledProductRegistration&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;#110&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;#112&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;, IconResourceID = 400)]&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;These IDs refer to string and icon resources in the &lt;strong&gt;VSPackage.resx&lt;/strong&gt; file as shown in Figure 12.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0312_5F00_1ADD865B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0312" border="0" alt="f0312" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0312_5F00_thumb_5F00_41AB9C9B.png" width="660" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 12&lt;/strong&gt;: &lt;em&gt;String resources in VSPackage.resx&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Package resources will be extracted from the content of the &lt;strong&gt;VSPackage.resx&lt;/strong&gt; file, so if you put them in the &lt;strong&gt;Resources.resx&lt;/strong&gt; file, the package will not find the resource. Although you can put functional resources into &lt;strong&gt;VSPackage.resx&lt;/strong&gt; file, their recommended place is the&lt;strong&gt; Resources.resx&lt;/strong&gt; file.&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc234410295"&gt;&lt;/a&gt;&lt;a name="_Toc224959890"&gt;&lt;/a&gt;The Package Build Process&lt;/h2&gt;  &lt;p&gt;Understanding the package build process can help a lot when you are about to debug or deploy your application. In this part you’ll learn the steps of this process in details. &lt;/p&gt;  &lt;p&gt;Building a package is not simply compiling the package source code into a .NET assembly. There are other important steps to complete in order to use the package either in the Experimental Instance or in its productive environment.&lt;/p&gt;  &lt;p&gt;When the wizard generates the package it adds new build targets to the &lt;strong&gt;.csproj&lt;/strong&gt; file of the corresponding class library. You can discover these entries by first unloading the project and then editing the project file. If you want to try it, first right-click on the project file in Solution Explorer and use the Unload Project function, then activate the Edit FirstLook.csproj command also with right-click. When you scroll down to the bottom of the file you can discover the following entries:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a36bff8d-bbd7-445f-a039-8048cd64bfe9" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#fff;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0;padding:0 0 0 5px;"&gt; &lt;li&gt;&amp;lt;Import Project=&lt;span style="color:#a31515;"&gt;&amp;quot;$(MSBuildBinPath)&amp;#92;Microsoft.CSharp.targets&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;lt;Import Project=&lt;span style="color:#a31515;"&gt;&amp;quot;$(MSBuildExtensionsPath)&amp;#92;Microsoft&amp;#92;VisualStudio&amp;#92;v10.0&amp;#92;VSSDK&amp;#92;\uinput1?&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;Microsoft.VsSDK.targets&lt;span style="color:#a31515;"&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;The first Import entry can be found in any C# language projects to invoke the C# compiler and all the other tools (for example the resource compiler) to create the assemblies from the source project. The second Import entry is the one added by the VSPackage Wizard. The .targets file specified here contains Visual Studio SDK related build targets. If you would like to have a look at this file, you can find it in the &lt;em&gt;MSBuild\Microsoft\VisualStudio\v10.0\VSSDK&lt;/em&gt; folder under Program Files. This book is not about MSBUILD, so you won’t find more explanations about what the build targets describe and how they internally work, instead, here are the steps of the package build process:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The Resources.resx and VSPackage.resx files are compiled into the corresponding .resource files. &lt;/li&gt;    &lt;li&gt;With the help of the vsct.exe utility the content of the .vsct file belonging to the package is compiled into a binary file called CTO file. This file format is used by Visual Studio when merging the package menu and command information into the IDE menu. &lt;/li&gt;    &lt;li&gt;The CTO file is merged into the VSPackage.resource file as a binary resource with the name of Menus.ctmenu. &lt;/li&gt;    &lt;li&gt;The C# compiler is invoked to compile the project source code just like normally when we build a standard class library. During this step the Resources.resources file and the VSPackage.resources files are embedded into the assembly. &lt;/li&gt;    &lt;li&gt;The CreatePkgDef.exe utility is executed and it scans the assembly for registration metadata information. Each registration attribute is translated to corresponding registry data. The utility is parameterized so that it creates a .pkgdef text file containing the information that is to be entered into the system registry. &lt;/li&gt;    &lt;li&gt;The binaries of the package (including the .dll and .pdb file), the corresponding .pkgdef file and the VSIX manifest file are zipped into a file with .vsix extension. This .vsix file is the installation kit of the package. You will find this file just beside the binaries (in the bin\Debug or bin\Release or maybe in another folder depending on the build configuration). With double clicking on this file you can start the Visual Studio Extension Installer utility. &lt;/li&gt;    &lt;li&gt;The .vsix file is installed in your LocalAppData folder under the Extensions subfolder of the Visual Studio Experimental Instance. The location of this folder depends on your user account and profile type. For example, if your user name is jsmith, you have installed Windows 7 on your C: drive and you have a local profile the build process will look for the &lt;em&gt;C:\Users\jsmith\AppData\Local\Microsoft\VisualStudio&lt;/em&gt; folder and install the .vsix file under the&lt;em&gt; 10.0Exp\Extensions&lt;/em&gt; subfolder. The extension will be enabled (setting a key in the registry). &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;As a result of the build process the package is available in the Experimental Instance. The next time you start the Experimental Instance, it scans the Extensions folder, uses the .pkgdef file of your package to create the appropriate registry settings, the package’s menus gets merged into the IDE, so your package is ready to run.&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc234410296"&gt;&lt;/a&gt;&lt;a name="_Toc224959891"&gt;&lt;/a&gt;Debugging Visual Studio Packages&lt;/h2&gt;  &lt;p&gt;Anyone who develops software creates programming mistakes. Majority of them can be caught during a simple or more complex code review. Many of them are obvious and you can find them in the code after observing the faulty behavior. There are a few of them which cannot be easily caught without using a debugger.&lt;/p&gt;  &lt;p&gt;Developing VSPackages is the same story. Sooner or later you find yourself debugging a package and searching for a bug. This book does not want to go into details about debugging techniques; this is definitely not its topic. However, you will learn how easy is to debug your package and what is going behind the scenes.&lt;/p&gt;  &lt;p&gt;To debug or run a package you should set it as the startup project. If your package is the only project is the solution, it is already marked so. If you have more projects in the solution, you should mark any VSPackage project as the startup project.&lt;/p&gt;  &lt;p&gt;Independently if you run a package with or without debugging, the Visual Studio Experimental Instance is started. You can check it on the project property pages on the Debug tab as Figure 13 shows it for the FirstLook project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0313_5F00_3A8C6023.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0313" border="0" alt="f0313" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0313_5F00_thumb_5F00_1A715366.png" width="629" height="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 13&lt;/strong&gt;: &lt;em&gt;Debug properties&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;You can see that devenv.exe is selected as the startup project and it is launched with the&lt;strong&gt; /rootsuffix Exp&lt;/strong&gt; command line parameters. As you have learnt before this command line starts the Experimental Instance.&lt;/p&gt;  &lt;p&gt;When you start the project with the Start Debugging (F5) function Visual Studio attaches the debugger to the Experimental Instance and so you can set breakpoints in Visual Studio. As your package running in the Experimental Instance reaches a breakpoint, you are taken back to the debug view as Figure 14 illustrates it. In this case a breakpoint was set within the Initialize method of the &lt;strong&gt;FirstLookPackage&lt;/strong&gt; class.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0314_5F00_6564C435.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0314" border="0" alt="f0314" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0314_5F00_thumb_5F00_73370A30.png" width="611" height="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 14&lt;/strong&gt;: &lt;em&gt;The debugger in action&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;You can use the same techniques for debugging a VSPackage as for any other applications. All debugging features of Visual Studio are accessible: you can watch variables, evaluate expressions, set up conditional breakpoints, and so on.&lt;/p&gt;  &lt;p&gt;There are cases when you would like to trace your application without a debugger using trace messages. You can follow this practice with Visual Studio. The simplest one is writing to the Debug pane of the Output window. You can learn about this topic in Chapter 3.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc234410297"&gt;&lt;/a&gt;&lt;a name="_Toc224959892"&gt;&lt;/a&gt;Deploying a Package&lt;/h2&gt;  &lt;p&gt;It is very comfortable to use the Experimental Instance while developing a package. The build process takes care about setting up your package to work, so you can use either the Start Debugging or Start Without Debugging commands to try what you’ve created. However, when your package is ready for distribution you should care about deployment questions.&lt;/p&gt;  &lt;h3&gt;Package Deployment in the Past&lt;/h3&gt;  &lt;p&gt;With Visual Studio versions preceding 2010 developers had to do some extra activities to prepare packages for deployment and it has a few potential pitfalls. The two main issues were that you needed to obtain a so-called Package Load Key (PLK) through a web page and take care of entering the required entries into the registry to allow Visual Studio recognize and integrate your package.&lt;/p&gt;  &lt;p&gt;¾ Any change in package information like name, GUID, company or version required obtaining a new PLK. The Experimental Hive (this is what is now called Experimental Instance) did not check the PLK by default, so it often happened that developers faced with a wrong (missing or not renewed) PLK only after the installation kit was built and tested in the production Visual Studio environment.&lt;/p&gt;  &lt;p&gt;¾ While the build process automatically registered the package under the Experimental Hive, developers had to create their own registration mechanism in the installation kit. It was not difficult, but because it was not automatic, forgotten registration updates could have led to annoying issues.&lt;/p&gt;  &lt;h3&gt;The VSIX installation&lt;/h3&gt;  &lt;p&gt;The new deployment mechanism built into Visual Studio 2010 removes this pain and provides an easy and straightforward way for package deployment.&lt;/p&gt;  &lt;p&gt;Generally the easiest form of deploying an artifact is if you have an installation kit. The package build process as treated earlier creates this installation kit as a .vsix file containing the package binaries and some additional information. You can distribute your package by simply distributing the .vsix file to your customers. When they receive it, the Visual Studio Extension Installer utility can be started with double clicking on the .vsix file as Figure 15 illustrates.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0315_5F00_12E5E3F9.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0315" border="0" alt="f0315" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0315_5F00_thumb_5F00_72CAD73B.png" width="480" height="364" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 15&lt;/strong&gt;: &lt;em&gt;Installing a VSIX file&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;When you click install the content of the VSIX file will be installed to the specified Visual Studio instance.&lt;/p&gt;  &lt;p&gt;If you create a package for a broad set of customers or for the community, you can upload the VSIX file to the Visual Studio Gallery. The new Shell of Visual Studio contains a great tool called Extension Manager that is able to search this gallery for extensions, install or remove them, and keep track of installed extensions as well as managing their updates. Figure 16 shows a screenshot of the Extension Manager browsing the extensions available on Visual Studio Gallery.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0316_5F00_52AFCA7E.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="f0316" border="0" alt="f0316" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/divedeeper/f0316_5F00_thumb_5F00_648C5E4B.png" width="660" height="407" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 16&lt;/strong&gt;: &lt;em&gt;Browsing Visual Studio Gallery with the Extension Manager&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;You can select any of the components while browsing, and on the right pane of the window you find some more details about the highlighted item. With the More Information link you will be directed to component’s home page on the Visual Studio Gallery. If you like this component, you can get it with the Download button just as others can obtain your uploaded components. The Extension Manager is the recommended way to obtain extensions. Because it runs within a Visual Studio instance, you can use it to install a separate set of components for your development environment and for the Experimental Instance. When using the Visual Studio Extension Installer utility your components will be installed under the normal development environment by default. &lt;/p&gt;  &lt;p&gt;It was mentioned earlier that the build process packages the binaries and some other files into the VSIX file. In order the installation process could understand your .vsix installation file you need to create a so-called VSIX manifest file that is the soul of the installation kit. This file describes the metadata that is used as the set of instructions about what, where and how should be put during the setup. The VSPackage Wizard automatically creates this manifest for you and names the file as source.extension.vsixmanifest. You are probably not surprised that the manifest is an XML file with its own schema. When the FirstLook package was generated the wizard created the manifest shown in Listing 3:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Listing 3&lt;/strong&gt;: &lt;em&gt;source.extension.vsixmanifest&lt;/em&gt;&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:949cde0d-2ec1-4331-9c9b-15cc387bbd83" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#fff;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0;padding:0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515;"&gt;xml&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;version&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;encoding&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;?&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Vsix&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;Version&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;1.0.0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;http://schemas.microsoft.com/developer/vsx-schema/2010&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Identifier&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;Id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;d55758eb-6581-48fe-930b-f3536f43b6f0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;FirstLook&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Author&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;DeepDiver&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Author&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Version&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;1.0&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Version&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Description&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;xml:space&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;preserve&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;Demonstrates the basic VSPackage concepts&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Description&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Locale&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;1033&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Locale&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;InstalledByMsi&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;false&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;InstalledByMsi&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SupportedProducts&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;VisualStudio&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;Version&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;10.0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Edition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;Pro&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Edition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;VisualStudio&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SupportedProducts&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SupportedFrameworkRuntimeEdition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;MinVersion&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;4.0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;MaxVersion&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt;4.0&lt;/span&gt;&amp;quot;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Identifier&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;References&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;References&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Content&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;VsPackage&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;|FirstLook;PkgdefProjectOutputGroup|&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;VsPackage&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Content&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Vsix&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;The root element of the manifest structure is the VSIX element that uses the &lt;em&gt;http://schemas.microsoft.com/developer/vsx-schema/2010 &lt;/em&gt;namespace. The manifest contains three sections:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Identifier&lt;/strong&gt; is used to uniquely define the different installation packages. The information here is used by the setup mechanism to manage the initial setup and the updates using the &lt;strong&gt;Id&lt;/strong&gt; attribute and &lt;strong&gt;Version&lt;/strong&gt; element values. This section also contains information describing the package and attributes taken into account during the setup process. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;References&lt;/strong&gt; element contains a collection of dependencies. Each item is a &lt;strong&gt;Reference&lt;/strong&gt; element which defines a dependency on another product. In the FirstLook.vsix sample the package contains one dependency. &lt;/li&gt;    &lt;li&gt;The &lt;strong&gt;Content&lt;/strong&gt; element is a collection of content items that are packed in the payload. It our case the content is a VSPackage where the value of the item is used to generate the .pkgdef file containing the package information. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;When running the Visual Studio Extension Installer or using the Extension Manager, the VSIX manifest is used to determine how the VSIX package should be set up. The VSPackage content type tells the installer that the related FirstLook.pkgdef file will contain the information to be put into the registry in order to register the COM object representing a Visual Studio package. The FirstLook.pkgdef file that has been created during the build process contains the information in Listing 4:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Listing 4&lt;/strong&gt;: &lt;em&gt;FirstLook.pkgdef&lt;/em&gt;&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:16cbe7ab-519e-483a-b216-ec6e6f03e074" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#fff;overflow:auto;"&gt; &lt;ol style="background:#ffffd5;margin:0;padding:0 0 0 5px;"&gt; &lt;li&gt;[$RootKey$&amp;#92;InstalledProducts&amp;#92;FirstLookPackage]&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;@=&amp;quot;#110&amp;quot;&lt;/li&gt; &lt;li&gt;&amp;quot;Package&amp;quot;=&amp;quot;{d55758eb-6581-48fe-930b-f3536f43b6f0}&amp;quot;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;quot;PID&amp;quot;=&amp;quot;1.0&amp;quot;&lt;/li&gt; &lt;li&gt;&amp;quot;ProductDetails&amp;quot;=&amp;quot;#112&amp;quot;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;quot;LogoID&amp;quot;=&amp;quot;#400&amp;quot;&lt;/li&gt; &lt;li&gt;[$RootKey$&amp;#92;Packages&amp;#92;{d55758eb-6581-48fe-930b-f3536f43b6f0}]&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;@=&amp;quot;DeepDiver.FirstLook.FirstLookPackage, FirstLook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8e5c6425e9b83cf4&amp;quot;&lt;/li&gt; &lt;li&gt;&amp;quot;InprocServer32&amp;quot;=&amp;quot;$WinDir$&amp;#92;SYSTEM32&amp;#92;MSCOREE.DLL&amp;quot;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;&amp;quot;Class&amp;quot;=&amp;quot;DeepDiver.FirstLook.FirstLookPackage&amp;quot;&lt;/li&gt; &lt;li&gt;&amp;quot;CodeBase&amp;quot;=&amp;quot;$PackageFolder$&amp;#92;FirstLook.dll&amp;quot;&lt;/li&gt; &lt;li style="background:#f3f3c9;"&gt;[$RootKey$&amp;#92;Menus]&lt;/li&gt; &lt;li&gt;&amp;quot;{d55758eb-6581-48fe-930b-f3536f43b6f0}&amp;quot;=&amp;quot;, Menus.ctmenu, 1&amp;quot;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;The content of this file resembles to the content of a .reg file that can be exported from or imported to the Windows registry. However, the .pkgdef file contains a few tokens closed between dollar signs. The values of these tokens are passed by the context of the .pkgdef file to the entity processing the file content.&lt;/p&gt;  &lt;p&gt;For example, if you use the Visual Studio Extension Installer utility to process the .vsix file, the utility extracts the payload into the &lt;em&gt;Microsoft\VisualStudio\10.0\Extensions &lt;/em&gt;subfolder under the &lt;em&gt;LocalAppData&lt;/em&gt; folder of your user profile. The files are put not directly into the Extension folder but into the subfolder calculated from the &lt;strong&gt;Author&lt;/strong&gt;, &lt;strong&gt;Name&lt;/strong&gt; and &lt;strong&gt;Version&lt;/strong&gt; elements of the manifest’s Identity section. In this case the payload includes the FirstLook.pkgdef and FirstLook.dll files beside a few others.&lt;/p&gt;  &lt;p&gt;When Visual Studio starts, it recognizes that a new .pkgdef file is under the Extensions folder and processes it. It substitutes the &lt;strong&gt;$RootKey$&lt;/strong&gt; token with the corresponding registry root of Visual Studio 2010,&lt;strong&gt; $Windir$&lt;/strong&gt; with the current Windows installation folder,&lt;strong&gt; $PackageFolder$&lt;/strong&gt; with the encapsulating folder of the .pkgdef file. After Visual Studio startup finishes, all information required to find and load the package is entered into the registry. When the first action demanding the package is executed, Visual Studio can pick up and initialize it.&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc234410298"&gt;&lt;/a&gt;&lt;a name="_Toc224959896"&gt;&lt;/a&gt;Summary&lt;/h2&gt;  &lt;p&gt;A VSPackage is the principal architectural unit of Visual Studio, a container for extensibility objects. It is also a unit from deployment, security and licensing aspects. Packages are not loaded immediately as Visual Studio starts, they are read into the memory on-demand at the first time when any of their objects or services is about to be used.&lt;/p&gt;  &lt;p&gt;The process of integrating a package physically into the Shell is called siting. While the package is not sited, its functions cannot be used from outside. As soon as the package gets sited, it is ready to finish its initialization and be fully functional. Siting happens when Visual Studio loads the package.&lt;/p&gt;  &lt;p&gt;Visual Studio keeps track of packages installed through registration, and package information is stored in the system registry under a specific Visual Studio key. With command line parameters this registration key can be suffixed in order to use another configuration set — even with separate package registration parameters.&lt;/p&gt;  &lt;p&gt;The Visual Studio SDK sets up the Visual Studio Experimental Instance which is a test bed to run and debug Visual Studio packages during the development and test phases. The Experimental Instance is not a separate Visual Studio installation, it uses the same devenv.exe file but with different configuration settings.&lt;/p&gt;  &lt;p&gt;VSPackages use a build process that contains some additional steps in order to prepare the packages for debugging or deployment. The easiest way to create a package is running the VSPackage Wizard which sets up the build process appropriately. During this process package infrastructure resources — like to so-called command table — are embedded into the package assembly, the package installation kit is created and installed under the Experimental Instance.&lt;/p&gt;  &lt;p&gt;During the development phase packages run inside the process space of the Experimental Instance and the same debug techniques can be used for tracing and troubleshooting as for any other .NET applications.&lt;/p&gt;  &lt;p&gt;VSPackage deployment in Visual Studio 2010 became really simple related to the preceding versions. The package installation kit is represented by a VSIX file that can be distributed directly to the users of your package or — and this way opens up brand new opportunities — uploaded to the Visual Studio Gallery. The Extension Manager built into the IDE can be used to browse, install, and remove VSPackages (and many other kinds of extensions) as well as to keep track of them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1926" width="1" height="1"&gt;</description></item><item><title>First Official SharePoint Experts Chat with a lot of MVPs</title><link>http://dotneteers.net/blogs/aghy/archive/2010/03/02/first-official-sharepoint-experts-chat-with-a-lot-of-mvps.aspx</link><pubDate>Tue, 02 Mar 2010 09:09:18 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1923</guid><dc:creator>aghy</dc:creator><slash:comments>1</slash:comments><description>The very first Official SharePoint Experts Chat will coming on March 15, 9:00 a.m. Pacific Time (18:00 Central European Time): “Do you have tough technical questions regarding SharePoint for which you&amp;#39;re seeking answers? Do you want to tap into the deep knowledge of the talented Microsoft Most Valuable Professionals? The SharePoint MVPs are the same people you see in the technical community as authors, speakers, user group leaders and answerers in the MSDN forums. This is the first time we have...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2010/03/02/first-official-sharepoint-experts-chat-with-a-lot-of-mvps.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1923" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/event/default.aspx">event</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+Experts+Chat/default.aspx">SharePoint Experts Chat</category></item><item><title>SharePoint Server 2010 Command Line Configuration</title><link>http://dotneteers.net/blogs/aghy/archive/2010/02/25/sharepoint-server-2010-command-line-configuration.aspx</link><pubDate>Thu, 25 Feb 2010 21:17:15 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1916</guid><dc:creator>aghy</dc:creator><slash:comments>1</slash:comments><description>Lately, I’ve been installing a brand new SharePoint 2010 farm. The installation went smoothly, but the Configuration Wizard gave me a “Configuration Failed” message, with a TimeOut error in the 2nd step. Next try – the same result in the 5th step. After some trying I gave up to try again with the visual Configuration Wizard, but give a chance to the command line configuration. I made the following steps: 1. psconfig –cmd configdb – This steps is required if you run the configuration first. In my...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2010/02/25/sharepoint-server-2010-command-line-configuration.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1916" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/administration/default.aspx">administration</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/installation/default.aspx">installation</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/configuration/default.aspx">configuration</category></item><item><title>SPSEMEA Recordings Available for Download</title><link>http://dotneteers.net/blogs/aghy/archive/2010/02/23/spsemea-recordings-available-for-download.aspx</link><pubDate>Tue, 23 Feb 2010 10:57:14 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1912</guid><dc:creator>aghy</dc:creator><slash:comments>0</slash:comments><description>Either you participated or not – SPSEMEA recorded sessions are available for download! Download them from here , extract and enjoy!...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2010/02/23/spsemea-recordings-available-for-download.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1912" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/event/default.aspx">event</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+Saturday+EMEA/default.aspx">SharePoint Saturday EMEA</category></item><item><title>New Expression Blend screencast series</title><link>http://dotneteers.net/blogs/vbandi/archive/2010/02/11/new-expression-blend-screencast-series.aspx</link><pubDate>Thu, 11 Feb 2010 22:41:24 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1892</guid><dc:creator>vbandi</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;I have begun new series of screencasts on SilverlightShow.net. Here is the expert:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 0px 0px 10px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" align="right" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_7C2A26E7.png" width="244" height="103" /&gt; &lt;em&gt;“As I promised earlier on Silverlight Show, this screencast series will show how to create the showcase application shown on &lt;/em&gt;&lt;a href="http://www.response.hu/"&gt;&lt;em&gt;www.response.hu&lt;/em&gt;&lt;/a&gt;&lt;em&gt; (you may want to read the &lt;/em&gt;&lt;a href="http://www.silverlightshow.net/ItemView.aspx?urlTitle=Silverlight-MVP-Andr-s-Velv-rt-tells-the-story-behind-the-creation-of-his-portal-www.response.hu-and-two-of-his-award-winning-projects"&gt;&lt;em&gt;interview&lt;/em&gt;&lt;/a&gt;&lt;em&gt; to get some background information on the project). The screencast series shows a real life example of how designers can add value to a project, and how a developer can support this effort by creating small, reusable behaviors that allow the designer to tweak things to shape the end result to be exactly as he wanted it.”&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I would very much love to hear your opinion! Please leave feedback at the &lt;a href="http://www.silverlightshow.net/items/Transforming-an-Ugly-Duckling-to-a-Graceful-Swan-with-Expression-Blend-and-Silverlight-Part-I.aspx" target="_blank"&gt;article&lt;/a&gt;, and let me know what you think about the format, the depth and the general direction it is going.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1892" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/User+Experience/default.aspx">User Experience</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Expression+Blend/default.aspx">Expression Blend</category></item><item><title>Extract styles in Expression Blend</title><link>http://dotneteers.net/blogs/vbandi/archive/2010/01/19/extract-styles-in-expression-blend.aspx</link><pubDate>Tue, 19 Jan 2010 15:34:21 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1817</guid><dc:creator>vbandi</dc:creator><slash:comments>9</slash:comments><description>&lt;p&gt;You may have found yourself in a situation when you want to convert an implicit style in XAML into a resource. Until today, I did it with creating the new style, and adding the setters manually. But I thought “There must be some way in Expression Blend to do this better”. I couldn’t find anything on the net, so I started to look for the solution myself. And yeah, I found it… Here is how it is done:&lt;/p&gt;  &lt;p&gt;Suppose, you have a TextBox that has a lot of settings on it:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_18618F7F.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_77DA4FCC.png" width="135" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;lt;TextBlock Margin=&amp;quot;50,96,0,0&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Text=&amp;quot;TextBlock&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot; FontSize=&amp;quot;96&amp;quot; FontFamily=&amp;quot;Comic Sans MS&amp;quot; FontWeight=&amp;quot;Bold&amp;quot; HorizontalAlignment=&amp;quot;Left&amp;quot; Width=&amp;quot;248&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBlock.Projection&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;PlaneProjection RotationY=&amp;quot;-57&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/TextBlock.Projection&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBlock.Effect&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;DropShadowEffect BlurRadius=&amp;quot;9&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/TextBlock.Effect&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBlock.Foreground&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;LinearGradientBrush EndPoint=&amp;quot;0.5,1&amp;quot; StartPoint=&amp;quot;0.5,0&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;GradientStop Color=&amp;quot;Black&amp;quot; Offset=&amp;quot;0&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;GradientStop Color=&amp;quot;#FFE82E2E&amp;quot; Offset=&amp;quot;1&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/LinearGradientBrush&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/TextBlock.Foreground&amp;gt;    &lt;br /&gt;&amp;lt;/TextBlock&amp;gt;&lt;/p&gt;  &lt;p&gt;Now, you want to take the font settings, the drop shadow and the Black-Blue foreground gradient and reuse it on another TextBlock. Here is where extracting the style comes handy. &lt;/p&gt;  &lt;p&gt;First, select the TextBlock, and choose Object / Style / Create Empty from the menu. There is NO right click option for this command! Then choose a name for your style resource.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_17892995.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_054062D3.png" width="455" height="258" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, we are in Resource editing mode:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_7701E9E2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_48A86435.png" width="244" height="131" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the Properties tab, you can see all our settings. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_644CF02B.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_47CFFE4B.png" width="310" height="366" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But the Property Peg is empty (gray). What happens if we click on it?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_3C3A410C.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_3BCE0E17.png" width="309" height="356" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, if we click on “Convert To Local Value”, the Peg turns white, and the Foreground gradient will be moved to the style!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_3B61DB22.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_6C14E2CD.png" width="958" height="833" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can see that the TextBlock does not contain the Foreground property anymore, but the TextBlockStyle1 style does. We can go and “Convert to Local Value” for all properties we want in the style. Even the drop shadow and the Perspective transform can be extracted this way.&lt;/p&gt;  &lt;p&gt;Here is the end result:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_3F8BB2E7.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_30E10702.png" width="633" height="873" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Nice and clean XAML for the TextBlock, and the style is ready to be reused. Great!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1817" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/WPF/default.aspx">WPF</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Expression+Blend/default.aspx">Expression Blend</category></item><item><title>SharePoint Saturday EMEA – This Saturday!</title><link>http://dotneteers.net/blogs/aghy/archive/2010/01/19/sharepoint-saturday-emea-this-saturday.aspx</link><pubDate>Tue, 19 Jan 2010 10:29:01 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1814</guid><dc:creator>aghy</dc:creator><slash:comments>1</slash:comments><description>SharePoint Saturday EMEA is an all-day, online, free event aligned to the EMEA Time Zones, with speakers from around the world. It’s going to be a huge, awesome event, you should not miss out! You need more information , or want to register immediately? Don’t hesitate! See you on Saturday!...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2010/01/19/sharepoint-saturday-emea-this-saturday.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1814" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/event/default.aspx">event</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+Saturday+EMEA/default.aspx">SharePoint Saturday EMEA</category></item><item><title>Interview with Silverlightshow.net and a sneak preview of my next articles</title><link>http://dotneteers.net/blogs/vbandi/archive/2010/01/16/interview-with-silverlightshow-net-and-a-sneak-preview-of-my-next-articles.aspx</link><pubDate>Sat, 16 Jan 2010 13:51:11 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1781</guid><dc:creator>vbandi</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;&lt;a href="http://www.silverlightshow.net/" target="_blank"&gt;SilverlightShow&lt;/a&gt; recently published an interview with me. They asked about how the showcase app at &lt;a href="http://www.response.hu"&gt;www.response.hu&lt;/a&gt; came to be, and asked me to talk about two of my &lt;a href="http://www.response.hu" target="_blank"&gt;company’s&lt;/a&gt; award winning projects: The Muvesz WPF application (&lt;a href="http://msdn.microsoft.com/en-us/library/bb985494.aspx" target="_blank"&gt;Architecture Journal article is here&lt;/a&gt;), and &lt;a href="http://www.zoomery.com" target="_blank"&gt;Zoomery&lt;/a&gt;, our Silverlight deep zoom framework. &lt;/p&gt;  &lt;p&gt;In the interview, I also revealed that I will be doing a series of articles / screencasts on how the &lt;a href="http://www.response.hu"&gt;www.response.hu&lt;/a&gt; showcase app was built. The focus will be on using Blend with tips and tricks, and creating custom behaviors to give designers maximum control over the user experience. Essentially, we will go from this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_514F4E04.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_7025C1E2.png" width="563" height="446" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_1D3AAEB1.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_1A4549FE.png" width="776" height="313" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first article should be up on SilverlightShow within a few weeks. I’ll keep you posted :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1781" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category></item><item><title>Planning for Enterprise Search</title><link>http://dotneteers.net/blogs/aghy/archive/2010/01/14/planning-for-enterprise-search.aspx</link><pubDate>Thu, 14 Jan 2010 15:21:05 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1766</guid><dc:creator>aghy</dc:creator><slash:comments>1</slash:comments><description>Enterprise Search is one of the topics that required in every organization but sometimes it doesn’t get enough resources. I don’t mean CPU, memory, etc. but human resources during the plan, deploy and configure the search infrastructure and architecture. Let me summarize some key components that you need to plan if you’d like to deploy an Enterprise Search for your SharePoint. As Seach plays different roles in every different organization, there is necessary to plan deeply and deploy carefully for...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2010/01/14/planning-for-enterprise-search.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1766" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/search/default.aspx">search</category></item><item><title>What Silverlight deed am I proud of in 2009?</title><link>http://dotneteers.net/blogs/vbandi/archive/2010/01/12/what-silverlight-deed-am-i-proud-of-in-2009.aspx</link><pubDate>Mon, 11 Jan 2010 23:54:20 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1755</guid><dc:creator>vbandi</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;em&gt;John Papa asked me (and other Silverlight MVPs) what was the one BIG thing we did around Silverlight in 2009. Here is what I had to say:&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;As a few of you may know, although I have technical background, I am really in love with Silverlight (and WPF) for the user experience it makes possible. I think my BIG thing was that I spread the love on tons of Silverlight and related topics during 2009. I had a 4 hour talk about UX, sketching and Sketchflow at the Architecture Forum; 4 hour talk about Silverlight, another one on NUI at the same place (and I got the highest ranks for the sketching talk out of 8 presenters). I talked about Silverlight 3 beta, and later about Silverlight 3 the next working day after it was released – in the middle of the summer, still over 90 people came. I participated in the local Silverlight 3 launch event later, in front of 500 people with sessions about SL3 and Blend. I had several other talks about Blend and Sketchflow, including a 5 minute(!) Sketchflow talk in front of Linux and Mac maniacs – and they liked it! I launched the Hungarian Silverlight User Group in December, and we already have 35 members, probably because they know me from the conferences. I wrote the WPF chapter of the book “Visual Studio 2010 and .Net Framework 4 Six-in-one” (&lt;a href="http://www.amazon.com/Visual-Studio-2010-NET-Six/dp/0470499486"&gt;http://www.amazon.com/Visual-Studio-2010-NET-Six/dp/0470499486&lt;/a&gt;), and convinced the editor to turn it around, focus on UX and Silverlight, and only add a little bit of WPF at the end. But the biggest result from all this preaching about UX and the great technologies that make it possible to concentrate on UX, is that I believe the Hungarian audience is starting to get it. They are realizing that getting developers to do UI may not be the best idea. They are realizing, that UX will be the differentiating factor for their products in the middle term. And spreading this word is my passion. Towards the last months of 2009, I started to receive feedback that the transition has started to happen in the minds of Hungarian developers and managers. This is probably what I am most proud of.&lt;/p&gt;  &lt;p&gt;Another big thing for me (but maybe not for Silverlight :) ) is that I became part of this awesome group [Silverlight MVPs], and had the chance to meet many of you online, or even in person. 33 days from now, I will be sitting on a plane to meet even more fellow MVPs at the Summit. Can’t wait!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1755" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/User+Experience/default.aspx">User Experience</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Happy New Year 2010!</title><link>http://dotneteers.net/blogs/aghy/archive/2010/01/01/happy_2D00_new_2D00_year_2D00_2010.aspx</link><pubDate>Fri, 01 Jan 2010 20:11:47 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1716</guid><dc:creator>aghy</dc:creator><slash:comments>1</slash:comments><description>I was pretty hidden in the last weeks: I wrote an article for SDN Magazine , and first time in my life: two chapters of a book! This book is not about SharePoint, but about Visual Studio 2010 and .NET 4.0 . A good friend of mine, Istvan Novak asked me to write these chapters about the history of .NET Framework and ASP.NET and I was very happy to work with him, moreover: all of the my Dotneteers friends are amongst the authors! Of course, we were also celebrating Christmas with my kids and family...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2010/01/01/happy_2D00_new_2D00_year_2D00_2010.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1716" width="1" height="1"&gt;</description></item><item><title>No more magic strings with VisualStateManager.GoToState</title><link>http://dotneteers.net/blogs/vbandi/archive/2009/12/29/no-more-magic-strings-with-visualstatemanager-gotostate.aspx</link><pubDate>Tue, 29 Dec 2009 22:00:00 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1687</guid><dc:creator>vbandi</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;This may come as no surprise for some, but only today have I discovered a way to get rid of the magic strings when changing states with the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager.gotostate(VS.95).aspx"&gt;VisualStateManager.GoToState&lt;/a&gt; method. The way Microsoft and many others were explaining the Visual State Manager is via a sample code like this:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;VisualStateManager.GoToState(control, &lt;span class="str"&gt;&amp;quot;statename&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;p&gt;
&lt;style&gt;&lt;/style&gt;
&lt;style&gt;&lt;/style&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately, this introduces a magic string, namely &amp;ldquo;statename&amp;rdquo;. The problem with the magic string here is that it creates a tight contract between the XAML (where the states are usually defined) and the code behind. It is very easy to mistype the name of the state in either place. Also, if the state is renamed by the designer in Blend, you get no compiler warnings or even runtime exceptions to point out the error.&lt;/p&gt;
&lt;p&gt;Here is a small XAML sample using the Visual States to move an ellipse to the right of a Grid:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt;  &lt;span class="attr"&gt;Background&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;LightBlue&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualStateGroup&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SG1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualStateGroup.Transitions&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualTransition&lt;/span&gt; &lt;span class="attr"&gt;GeneratedDuration&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;00:00:01&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualTransition.GeneratedEasingFunction&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ElasticEase&lt;/span&gt; &lt;span class="attr"&gt;EasingMode&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;EaseOut&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VisualTransition.GeneratedEasingFunction&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VisualTransition&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VisualStateGroup.Transitions&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualState&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SG1Normal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VisualState&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SG1EllipseRight&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Storyboard&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class="attr"&gt;BeginTime&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;00:00:00&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Duration&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;00:00:00.0010000&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Storyboard&lt;/span&gt;.&lt;span class="attr"&gt;TargetName&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ellipse&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Storyboard&lt;/span&gt;.&lt;span class="attr"&gt;TargetProperty&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;EasingDoubleKeyFrame&lt;/span&gt; &lt;span class="attr"&gt;KeyTime&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;00:00:00&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;320&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Storyboard&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VisualState&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VisualStateGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Ellipse&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ellipse&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Fill&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Red&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Stroke&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Black&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                 &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;116&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;HorizontalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;50,98,0,0&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                 &lt;span class="attr"&gt;VerticalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;235&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;RenderTransformOrigin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5,0.5&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Ellipse.RenderTransform&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TransformGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ScaleTransform&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;SkewTransform&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RotateTransform&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TranslateTransform&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TransformGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Ellipse.RenderTransform&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Ellipse&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;style&gt;&lt;/style&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The key to my &amp;ldquo;discovery&amp;rdquo; is realizing that the VisualState elements have an x:Name attribute, and therefore fields get generated for them in the codebehind. So, instead of &lt;/p&gt;
&lt;pre class="csharpcode"&gt;VisualStateManager.GoToState(control, &lt;span class="str"&gt;&amp;quot;SG1EllipseRight&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;p&gt;We can write:&lt;/p&gt;
&lt;pre class="csharpcode"&gt; VisualStateManager.GoToState(&lt;span class="kwrd"&gt;this&lt;/span&gt;, SG1EllipseRight.Name, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;p&gt;Now, if the state gets renamed, at least we get a compiler error, and there is no way that you can mistype the state name. &lt;/p&gt;
&lt;p&gt;Another advantage of accessing the states by name is that now it is easy to find when a state transition animation ends (like the one above). Just use the VisualState.Storyboard.Completed event:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;SG1EllipseRight.Storyboard.Completed += (sender, args) =&amp;gt; 
      MessageBox.Show(&lt;span class="str"&gt;&amp;quot;Ellipse move finished!&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;p&gt;
&lt;style&gt;&lt;/style&gt;
&lt;/p&gt;
&lt;p&gt;That is two big problems that I had with Visual States solved. Now if only I could get the current state somehow&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here&amp;nbsp; is a little bonus:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can also create some extension methods on VisualState as it may fit your way of thinking better:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; VisualStateHelper
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Activate(&lt;span class="kwrd"&gt;this&lt;/span&gt; VisualState state, Control control, &lt;span class="kwrd"&gt;bool&lt;/span&gt; useTransitions)
        {
            VisualStateManager.GoToState(control, state.Name, useTransitions);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Activate(&lt;span class="kwrd"&gt;this&lt;/span&gt; VisualState state, Control control)
        {
            state.Activate(control, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
        }
    }&lt;/pre&gt;
&lt;p&gt;
&lt;style&gt;&lt;/style&gt;
Now, to activate the SG1EllipseRight state above, all you have to write is:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;SG1EllipseRight.Activate(&lt;span class="kwrd"&gt;this&lt;/span&gt;)&lt;/pre&gt;
&lt;p&gt;
&lt;style&gt;&lt;/style&gt;
&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all, folks!&lt;/p&gt;
&lt;p&gt;
&lt;style&gt;&lt;/style&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1687" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category></item><item><title>Make a Silverlight TextBox update its binding on every character with a Behavior</title><link>http://dotneteers.net/blogs/vbandi/archive/2009/12/24/make-a-silverlight-textbox-update-its-binding-on-every-character.aspx</link><pubDate>Thu, 24 Dec 2009 00:06:00 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1654</guid><dc:creator>vbandi</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;An old problem with Silverlight TextBox is that it only updates its binding when the TextBox loses focus. This can cause a lot of problems, especially for LOB applications. Following a short discussion on Twitter with Rob Eisenberg (@&lt;a target="_blank" href="http://www.twitter.com/EisenbergEffect" class="null"&gt;EisenbergEffect&lt;/a&gt;), I tried to create a proof-of-concept behavior that can help ease this pain, at least until Silverlight gets an UpdateSourceTrigger that can handle the PropertyChanged value. (You can read more about the problem Rob had on &lt;a target="_blank" href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=521954#details"&gt;Connect&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The behavior itself is very simple:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; TextBoxUpdateBehavior : Behavior&amp;lt;TextBox&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnAttached()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnAttached();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            AssociatedObject.TextChanged += AssociatedObjectOnTextChanged;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AssociatedObjectOnTextChanged(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, TextChangedEventArgs args)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            var bindingExpr = AssociatedObject.GetBindingBLOCKED EXPRESSION;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            AssociatedObject.TextChanged -= AssociatedObjectOnTextChanged;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The key is in the TextChanged event handler. We simply get the Binding expression for the Text property of the TextBox, and call UpdateSource on it.&lt;/p&gt;
&lt;p&gt;I tested the behavior with both UI-2-UI binding and with binding to a ViewModel. Both work flawlessly, and they even work at the same time as this screenshot shows:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_1D0EE1F7.png"&gt;&lt;img height="69" width="582" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_thumb_5F00_3CBDBBBF.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;As you can see, the cursor is still in the TextBox, so I have not moved the focus away after typing.&lt;/p&gt;
&lt;p&gt;Here is the entire XAML: &lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;UserControl&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="attr"&gt;xmlns:x&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="attr"&gt;xmlns:d&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;xmlns:mc&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="attr"&gt;mc:Ignorable&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;d&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;xmlns:i&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;xmlns:local&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:SLTextBoxUpdateBinder&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;x:Class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SLTextBoxUpdateBinder.MainPage&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="attr"&gt;d:DesignWidth&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;640&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;d:DesignHeight&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;480&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;UserControl.DataContext&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;local:TestVM&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;UserControl.DataContext&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Binding using ViewModel: &amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{Binding TestProperty}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Rectangle&lt;/span&gt; &lt;span class="attr"&gt;Fill&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Black&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Binding using UI-2-UI binding&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{Binding Text, ElementName=tb}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Enter text here to see it shown above. No need to tab away!&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBox&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;tb&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{Binding TestProperty, Mode=TwoWay}&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;i:Interaction.Behaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;local:TextBoxUpdateBehavior&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;i:Interaction.Behaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TextBox&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;UserControl&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;I have attached the solution to this blog post. Marry Christmas everyone!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1654" width="1" height="1"&gt;</description><enclosure url="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.16.54/SLTextBoxUpdateBinder.zip" length="14798" type="application/x-zip-compressed" /><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category></item><item><title>VS 2010 and .NET 4 Six-In-One: My last chapter submitted today…</title><link>http://dotneteers.net/blogs/divedeeper/archive/2009/12/22/vs-2010-and-net-4-six-in-one-my-last-chapter-submitted-today.aspx</link><pubDate>Tue, 22 Dec 2009 13:08:53 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1644</guid><dc:creator>inovak</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A few weeks ago &lt;a href="http://dotneteers.net/blogs/divedeeper/archive/2009/09/26/VS2010Net4SixInOne.aspx"&gt;I shared the news&lt;/a&gt; with you that the Dotneteers team works on a book with an authoring team including other community members. Today I submitted my last (seventh) chapter dealing with the core enhancements of the .NET 4.0 Framework. The book is available on &lt;a href="http://www.amazon.com/Visual-Studio-2010-NET-Six/dp/0470499486/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259555648&amp;amp;sr=8-1"&gt;Amazon&lt;/a&gt; you can already preorder it. Visual Studio 2010 and .NET 4 Six-In-One will be published around Visual Studio 2010 launch time. Here is the short table of contents:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Chapter 1: History of Visual Studio and Current Editions&lt;/li&gt;    &lt;li&gt;Chapter 2: VS UI Enhancements&lt;/li&gt;    &lt;li&gt;Chapter 3: Visual Studio Snippets&lt;/li&gt;    &lt;li&gt;Chapter 4: Visual Studio Templates&lt;/li&gt;    &lt;li&gt;Chapter 5: Getting the most out of the IDE&lt;/li&gt;    &lt;li&gt;Chapter 6: Extending Visual Studio&lt;/li&gt;    &lt;li&gt;Chapter 7: .NET Framework Version History&lt;/li&gt;    &lt;li&gt;Chapter 8: Window Presentation Foundation WPF&lt;/li&gt;    &lt;li&gt;Chapter 9: Windows Communication Foundation&lt;/li&gt;    &lt;li&gt;Chapter 10: Enhancements to the .NET Core Framework&lt;/li&gt;    &lt;li&gt;Chapter 11: Enhancements to the .NET Workflow Framework&lt;/li&gt;    &lt;li&gt;Chapter 12: Enhancements to the .NET Data Framework&lt;/li&gt;    &lt;li&gt;Chapter 13: Enhancements to the .NET Communication Framework&lt;/li&gt;    &lt;li&gt;Chapter 14: Enhancements to the .NET Client Framework&lt;/li&gt;    &lt;li&gt;Chapter 15: .NET Charting Components&lt;/li&gt;    &lt;li&gt;Chapter 16: ASP.NET Version History&lt;/li&gt;    &lt;li&gt;Chapter 17: ASP.NET Charting Controls&lt;/li&gt;    &lt;li&gt;Chapter 18: ASP.NET Dynamic Data&lt;/li&gt;    &lt;li&gt;Chapter 19: ASP.NET MVC&lt;/li&gt;    &lt;li&gt;Chapter 20: ASP.NET Ajax Improvements&lt;/li&gt;    &lt;li&gt;Chapter 21: Ajax Control Toolkit, jQuery and More&lt;/li&gt;    &lt;li&gt;Chapter 22: Visual Basic History&lt;/li&gt;    &lt;li&gt;Chapter 23: Visual Basic 10 Language Improvements&lt;/li&gt;    &lt;li&gt;Chapter 24: C# History&lt;/li&gt;    &lt;li&gt;Chapter 25: C# 4 Language Improvements&lt;/li&gt;    &lt;li&gt;Chapter 26: Other .NET Languages&lt;/li&gt;    &lt;p&gt;&lt;/p&gt; &lt;/ul&gt;  &lt;p&gt;However the book focuses on new features in VS 2010 and .NET 4, even those who use .NET 1.1 or VS 2005 right now may find it useful.&lt;/p&gt;  &lt;p&gt;In the next few weeks you can read more details of the book, so stay tuned!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1644" width="1" height="1"&gt;</description></item><item><title>Another video from TechEd 2009</title><link>http://dotneteers.net/blogs/vbandi/archive/2009/12/18/another-video-from-teched-2009.aspx</link><pubDate>Fri, 18 Dec 2009 16:17:18 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1620</guid><dc:creator>vbandi</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Karen Young, the EMEA MVP lead has interviewed me last month in Berlin about who I am, what I did there and why I think being a developer is exciting. Here is the video:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=_9zYuFdh0mo" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_02E189E8.png" width="601" height="394" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1620" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/UX+Thoughts/default.aspx">UX Thoughts</category></item><item><title>Installing FAST Search Server for SharePoint 2010</title><link>http://dotneteers.net/blogs/aghy/archive/2009/12/10/installing-fast-search-server-for-sharepoint-2010.aspx</link><pubDate>Thu, 10 Dec 2009 12:04:10 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1585</guid><dc:creator>aghy</dc:creator><slash:comments>7</slash:comments><description>No, this time I won’t write a full step-by-step install guide of FAST Search Server for SharePoint 2010. If you’d like to get a detailed install guide, please go to the Microsoft Download Center and download the B2FASTSearchDeploy.xps from there. This is a very detailed, 59 pages long guide. Ohhhhhhh, is it too long and would you like to get some shorter summary? – Yes, you can find some shorter summary around the blogosphere. BUT, please, be careful as generally they miss some very important steps...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2009/12/10/installing-fast-search-server-for-sharepoint-2010.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1585" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/search/default.aspx">search</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/installation/default.aspx">installation</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/FAST+Search/default.aspx">FAST Search</category></item><item><title>SharePoint 2010 events</title><link>http://dotneteers.net/blogs/aghy/archive/2009/12/01/sharepoint-2010-events.aspx</link><pubDate>Tue, 01 Dec 2009 14:03:06 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1512</guid><dc:creator>aghy</dc:creator><slash:comments>0</slash:comments><description>Last week a lot of us were headed to Slovenia, to the Slovenian SharePoint Conference 2009 . It was an awesome conference, with a lot of useful and interesting SharePoint 2010 sessions. It’s a honor to me that I was one of the speakers as well the SharePoint Days as the Conference itself. My slide decks will be available to download from the conference site soon. Here are some upcoming events, either you missed the Slovenian SharePoint Conference or attended it but you’re interested in more SharePoint...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2009/12/01/sharepoint-2010-events.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1512" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/conference/default.aspx">conference</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+Best+Practices+Conference/default.aspx">SharePoint Best Practices Conference</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/event/default.aspx">event</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/HUNSUG/default.aspx">HUNSUG</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/Slovenian+SharePoint+Conference+2009/default.aspx">Slovenian SharePoint Conference 2009</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2010+Evolution+Conference/default.aspx">SharePoint 2010 Evolution Conference</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+Saturday+EMEA/default.aspx">SharePoint Saturday EMEA</category></item><item><title>SharePoint Server 2010 Prerequirities</title><link>http://dotneteers.net/blogs/aghy/archive/2009/11/19/sharepoint-server-2010-prerequirities.aspx</link><pubDate>Thu, 19 Nov 2009 22:30:59 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1453</guid><dc:creator>aghy</dc:creator><slash:comments>2</slash:comments><description>In case of you have to install SharePoint 2010 to a machine with no Internet access, here are some useful URLs where you can download these required components (and copy them manually to your offline machine): Geneva Framework, Microsoft.IdentityModel.dll 1.0.0.0: http://download.microsoft.com/download/F/3/D/F3D66A7E-C974-4A60-B7A5-382A61EB7BC6/MicrosoftGenevaFramework.amd64.msi (Be careful, Geneva Framework Beta2 comes with the DLL version 0.6.1.0 instead of 1.0.0.0) Microsoft Chart Controls for...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2009/11/19/sharepoint-server-2010-prerequirities.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1453" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/administration/default.aspx">administration</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/installation/default.aspx">installation</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category></item><item><title>Discovering Silverlight 4 – What is new?</title><link>http://dotneteers.net/blogs/vbandi/archive/2009/11/18/discovering-silverlight-4-what-is-new.aspx</link><pubDate>Wed, 18 Nov 2009 21:24:00 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1443</guid><dc:creator>vbandi</dc:creator><slash:comments>6</slash:comments><description>&lt;p&gt;Today, at the PDC in Los Angeles, Scott Guthrie revealed Silverlight 4 in his keynote. The painful silence enforced by the NDA is now over, and I can talk about all the cool new stuff on Silverlight 4!&lt;/p&gt;
&lt;p&gt;To me, the most amazing thing is how much the Silverlight team has been listening to the community. Just take a look at the Top 10 most requested SL4 features at: &lt;a href="http://silverlight.uservoice.com/pages/4325-feature-suggestions" title="http://silverlight.uservoice.com/pages/4325-feature-suggestions"&gt;http://silverlight.uservoice.com/pages/4325-feature-suggestions&lt;/a&gt;, and compare it with the whatsnew document -&amp;nbsp; 8 out of the top 10 requests are in the Beta, except for the two where iPhone and other device support is discussed. This is an amazing proof that the Silverlight Team is really customer-driven, congrats!&lt;/p&gt;
&lt;p&gt;So, here is the official &amp;ldquo;Summary of Features New in Silverlight 4&amp;rdquo;, with some of my additional explanations:&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;Runtime: Silverlight 4 is based on the CLR4 runtime. This means that we can use all the cool dynamic stuff from C# 4.0 &amp;ndash; much easier to communicate with DOM objects, Javascript, etc.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Out of Browser Apps&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Elevated Privilages Support &lt;em&gt;&amp;ndash; this is really huge, removes most of the security restrictions. A great new way to write more full-featured cross platform applications!&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;Cross Domain Networking Access &lt;em&gt;&amp;ndash; no more proxies for you Twitter client&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Full file path from Open/SaveFileDialog &lt;/li&gt;
&lt;li&gt;No User-Initiation Requirement for Full Screen, Open/SaveFileDialogs &amp;ndash; &lt;em&gt;however, you can only access files directly within the My Documents folder or the Mac equivalent&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;COM Interop: &lt;em&gt;obviously, this is Windows only. C# 4.0 dynamics helps here a lot&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;HTML Hosting Support &lt;em&gt;&amp;ndash; it would really be useful within the browser as well, but there were too many security considerations to make it happen in this release. Still, I can&amp;rsquo;t wait to see what people will cook up with this one&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Media&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;WMS Multicast Support &amp;ndash; &lt;em&gt;Save your server&amp;rsquo;s bandwidth when streaming videos!&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;MP4 Playback Protected by PlayReady DRM &amp;ndash; &lt;em&gt;Should help ease Hollywood&amp;rsquo;s mind a little bit&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Offline DRM &amp;ndash; &lt;em&gt;Download songs and movies, and play them without a network connection on the plane&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Output Protection &amp;ndash; &lt;em&gt;again, for helping Hollywood accept online media&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;WebCam / Mic Support &amp;ndash; &lt;em&gt;This is raw access only to the webcam or microphone data &amp;ndash; nothing fancy like streaming it to a server, etc. I am sure, the community will come up with that pretty soon&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Printing&lt;/strong&gt; &amp;ndash; &lt;em&gt;The number one requested feature, that was the biggest setback when discussing Silverlight based Line Of Business applications.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Text&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;RichTextBox&lt;/li&gt;
&lt;li&gt;Arabic and Hebrew Text Support &amp;ndash; &lt;em&gt;I had a few people specificly asking for this while helping out at the &amp;ldquo;Ask The Experts&amp;rdquo; booth during the TechEd in Berlin. I wish I could tell them what I knew&amp;hellip; NDA sometimes sucks&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;IME Improvements for TextBox&lt;/li&gt;
&lt;li&gt;UIElement.TextInput event &amp;ndash; &lt;em&gt;for when you want to validate or update on text changes in your textbox&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Controls, ControlModel, Layout&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Theming via Implicit Styles &amp;ndash; &lt;em&gt;No more need to specify styles for each and every button in your app&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;ViewBox &amp;ndash; &lt;em&gt;This extremely useful layout control is now mover to the the core runtime from the Toolkit&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;MouseWheel Support on ScrollViewer, TextBox, Combobox, Calendar, DatePicker &amp;ndash; &lt;em&gt;Yeah! I&amp;rsquo;ve missed it a lot&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;RTL Layout via UIElement.FlowDirection property &amp;ndash; &lt;em&gt;this one will also make some countries&amp;rsquo; developers happy&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;VisualStateGroup.CurrentStateGroup property &amp;ndash; &lt;em&gt;no more need to follow / guess states yourself. Altough a well-behaving ViewModel should already know the Visual State of the View&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;CommandProperty on ButtonBase &amp;amp; hHyperlink &amp;ndash; &lt;em&gt;Commanding is slowly getting there&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;SelectedValue and SelectedValuePath properties on Selector &amp;ndash; &lt;em&gt;very convenient thing for simple dropdowns, etc.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Drop files onto Silverlight from Exporer or Finder (Mac) &lt;em&gt;&amp;ndash; no need to browse, just drop files onto Silverlight!&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Networking&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Memory Usage Fix During Progressive Downloads &amp;ndash; &lt;em&gt;it is always good to fix memory usage&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Automatically adding Referrer Header &amp;ndash; &lt;em&gt;behaving like a good citizen&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Authentication Support on ClientHttpWebRequest &amp;ndash; &lt;em&gt;this one was really missed&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tools Support&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Dispatcher Support on the Tools Design Surface&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Databinding improvements&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;DataBinding Support for DependencyObjects &amp;ndash; Yeeee&lt;em&gt;y! Now you can bind to behaviors, and so much more. This one opens up quite a few new possibilities&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;IDataErrorInfo Support&lt;/li&gt;
&lt;li&gt;StringFormat, TargetNullValue &amp;amp; FallBackValue properties on Binding &amp;ndash; &lt;em&gt;This can save a lot of error handling code and replace basic converters&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;ObservableCollection&amp;lt;T&amp;gt; constructor that takes INumerable or IList &amp;ndash; Quickly f&lt;em&gt;ill up your ObservableCollection with data. &lt;/em&gt;&lt;/li&gt;
&lt;li&gt;IEditableCollectionView&lt;/li&gt;
&lt;li&gt;Grouping support on CollectionViewSource&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SDK&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Astoria 2.0 Support&lt;/li&gt;
&lt;li&gt;MEF &amp;ndash; &lt;em&gt;I am really interested in how this one works. As Yoda would say: &amp;ldquo;A lot of extensible Silverlight Applications in the future I see&amp;rdquo;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a pretty impressive feature set, especially as &lt;strong&gt;it has only been 4 months since the release of Silverlight 3&lt;/strong&gt;. What do you think?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1443" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Silverlight.net/default.aspx">Silverlight.net</category><category domain="http://dotneteers.net/blogs/vbandi/archive/tags/Discovering+Silverlight+4/default.aspx">Discovering Silverlight 4</category></item><item><title>Why these days are so important for us?</title><link>http://dotneteers.net/blogs/aghy/archive/2009/11/18/why-these-days-are-so-important-for-us.aspx</link><pubDate>Wed, 18 Nov 2009 08:50:18 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1441</guid><dc:creator>aghy</dc:creator><slash:comments>0</slash:comments><description>2010 is here! Don’t panic, not in the calendar yet, we’re in the middle of November, 2009 right now. But if you’re an MSDN subscriber, most probably you’ve found the surprises on your download site: Yes, SharePoint Foundation 2010, SharePoint Server 2010 and Office 2010 Beta2 applications are available to download. To be honest, I’ve been using the Technical Preview for months, and I’m absolutely love them. I’m sure you also will…...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2009/11/18/why-these-days-are-so-important-for-us.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1441" width="1" height="1"&gt;</description><category domain="http://dotneteers.net/blogs/aghy/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://dotneteers.net/blogs/aghy/archive/tags/Office+2010/default.aspx">Office 2010</category></item><item><title>My Teched Online talk: “Why Take User Experience Seriously?” is online</title><link>http://dotneteers.net/blogs/vbandi/archive/2009/11/18/my-teched-online-talk-why-take-user-experience-seriously-is-online.aspx</link><pubDate>Wed, 18 Nov 2009 06:52:38 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1439</guid><dc:creator>vbandi</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;During TechEd Europe, my friend &lt;a href="http://inovak.dotneteers.net" target="_blank"&gt;István Novák&lt;/a&gt; interviewed me about user experience.&amp;#160; Here is the resulting video:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.msteched.com/online/view.aspx?tid=daa2572e-7f58-4428-ad85-625cac61aa11"&gt;Why Take User Experience Seriously?&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The software development industry is changing; the focus is being shifted from technology to the users. Silverlight MVP András Velvárt shares his thoughts on why UX focus is a must for development teams, and what you can do to incorporate UX into the development process.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.msteched.com/online/view.aspx?tid=daa2572e-7f58-4428-ad85-625cac61aa11"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_4B78261D.png" width="244" height="132" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In return, I also interviewed István, and he talked about &lt;a href="http://www.msteched.com/online/view.aspx?tid=daa2572e-7f58-4428-ad85-625cac61aa11"&gt;Deploying Visual Studio 2010 Extensions&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Due to the COM roots of Visual Studio and the lack of the right tool set, deploying Visual Studio extension requires &amp;quot;creativity&amp;quot; from developers. Visual Studio 2010 is a great leap on this field with its brand new tools and technologies, including Extension Manager, Visual Studio Gallery and VSIX. This discussion will provide an overview of these tools and demonstrate how developers can leverage the synergy of these tools to remove the deployment pain.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.msteched.com/online/view.aspx?tid=e1124e24-5b37-498e-8ca6-a1aac565d085"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://dotneteers.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/vbandi/image_5F00_5F9142A6.png" width="244" height="116" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1439" width="1" height="1"&gt;</description></item><item><title>PDC 2009 Keynote – Tuesday</title><link>http://dotneteers.net/blogs/divedeeper/archive/2009/11/17/pdc-2009-keynote-tuesday.aspx</link><pubDate>Tue, 17 Nov 2009 15:52:08 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1434</guid><dc:creator>inovak</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;After 2008 Microsoft organized a PDC again without waiting for two or more years, as it usually happened in the past. Right now I’m setting here in the main auditorium of Los Angeles Convention Center and watching this years keynote. Well, people around my typing on their notebooks, writing their blogs or twitting about what they see and hear.&lt;/p&gt;  &lt;p&gt;Yesterday the first new thing happened, even before any official announcement, Microsoft Office 2010 Beta went to the MSDN Download Center. I’ve already started downloading it…&lt;/p&gt;  &lt;p&gt;A short summary about what kind of messages I’ve got during this keynote:&lt;/p&gt;  &lt;p&gt;Ray Ozzie, Chief Software Architect&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows Azure: One coherent model using Windows Server and System Center. Tools for developers: Windows Azure tools for Java and Eclipse, PHP application support &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Guest: Matt Mullenweg, Automaitc, manufacturer of WordPress:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Now WordPress works on Azure (oddlyspecific.com as one example) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Guest: Loic LeMear, Seesmic&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Created Silverlight prototype for a new Twitter browser. Easy to use with user lists, custom-defined columns. They are going to create a platform around this app allowing plug-in development. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Ray Ozzie, Chief Software Architect&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Announcement: Microsoft PinPoint for finding online Sharepoint and Exchange applications and other solutions &lt;/li&gt;    &lt;li&gt;Announcment: Microsoft Codename “Dallas” CTP, creating a uniform access and discovery for data, Data-as-a-Service &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Don Box, Chriss Sells:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;C++ code runs on Windows Azure, they demonstrated it. &lt;/li&gt;    &lt;li&gt;SQL Azure is easy, SQL Management Studio 2008 R2 supports it. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Bob Muglia, President, Server and Tools Business&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Announcement: Your enterprise services connected to Windows Azure, code name&amp;#160; “Project Sydney” &lt;/li&gt;    &lt;li&gt;Announcement: Windows Azure Virtual Machine Role &lt;/li&gt;    &lt;li&gt;Announcement: Windows Azure AppFabric (Caching, Workflow Hosting, Monitoring)&lt;/li&gt;    &lt;li&gt;Announcement: Windows Identity Foundation RTM&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Cameron Skinner:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Demos Azure development support with VS 2010 (AppFabric, WIF)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you can, watch the PDC Keynote video you can access from &lt;a href="http://microsoftpdc.com/"&gt;here.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1434" width="1" height="1"&gt;</description></item><item><title>Getting Started – How to Create an External List from Scratch?</title><link>http://dotneteers.net/blogs/aghy/archive/2009/11/12/getting-started-how-to-create-an-external-list-from-scratch.aspx</link><pubDate>Wed, 11 Nov 2009 23:26:25 GMT</pubDate><guid isPermaLink="false">74e06254-0e07-4c08-8611-9f55b924f030:1427</guid><dc:creator>aghy</dc:creator><slash:comments>3</slash:comments><description>As the next part of my Getting Started series, let’s see how we can create external lists - without any coding! Probably you’ve already heard the expressions “external list”, “external content type”, “Business Connectivity Services (BCS)”, etc., but do you really know what they mean? If your answer is yes, fell free to step over the next paragraphs :) Business Connectivity Services (BCS) provides the capability to connect SharePoint 2010 and Office 2010 client applications to external data sources...(&lt;a href="http://dotneteers.net/blogs/aghy/archive/2009/11/12/getting-started-how-to-create-an-external-list-from-scratch.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotneteers.net/aggbug.aspx?PostID=1427" width="1" height="1"&gt;</description></item></channel></rss>