<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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/"><channel><title>Unni's Blog : Extensibility</title><link>http://blogs.msdn.com/unnir/archive/tags/Extensibility/default.aspx</link><description>Tags: Extensibility</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>AlternateContentProperty attribute</title><link>http://blogs.msdn.com/unnir/archive/2009/03/28/alternatecontentproperty-attribute.aspx</link><pubDate>Sat, 28 Mar 2009 23:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9516314</guid><dc:creator>unnir</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/unnir/comments/9516314.aspx</comments><wfw:commentRss>http://blogs.msdn.com/unnir/commentrss.aspx?PostID=9516314</wfw:commentRss><description>&lt;P&gt;A new extension point we have added to Blend 3 (based on very popular demand) can be seen put to good use with the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430"&gt;Silverlight Chart control&lt;/A&gt; - we call it the AlternateContentProperty attribute. Annotating the properties of&amp;nbsp;a control with this attribute allows you to select objects that are set as values (including DepedencyObjects) to be selected in the Blend object tree, thereby exposing a ton of new functionality like the&amp;nbsp;ability to set properties on those objects, edit templates if those objects were FrameworkElements, or set new objects as values of these properties.&lt;/P&gt;
&lt;P&gt;Kudos to the Silverlight toolkit team for jumping onto this (I hope a lot more people notice and use this feature in Blend 3&amp;nbsp;as it really, really&amp;nbsp;enables designers).&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://home.comcast.net/~unnir/images/ACP.jpg" mce_src="http://home.comcast.net/~unnir/images/ACP.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9516314" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/unnir/archive/tags/Blend+3/default.aspx">Blend 3</category><category domain="http://blogs.msdn.com/unnir/archive/tags/Extensibility/default.aspx">Extensibility</category></item><item><title>A sample that shows the new Blend design surface extensibility</title><link>http://blogs.msdn.com/unnir/archive/2009/03/27/a-sample-that-shows-the-new-blend-design-surface-extensibility.aspx</link><pubDate>Fri, 27 Mar 2009 23:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9515016</guid><dc:creator>unnir</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/unnir/comments/9515016.aspx</comments><wfw:commentRss>http://blogs.msdn.com/unnir/commentrss.aspx?PostID=9515016</wfw:commentRss><description>&lt;P&gt;Based on popular demand, &lt;A class="" href="http://home.comcast.net/~unnir/samples/InkControl.zip" mce_href="http://home.comcast.net/~unnir/samples/InkControl.zip"&gt;here&lt;/A&gt; is a quick sample (WPF only though it would be very easy to port this as-is to Silverlight - currently busy with Blend 3 work and all the cool newer features we are adding to Blend 3)&amp;nbsp;that will allow you to get started on the following new extension points we have added to Blend 3:&lt;BR&gt;a) The new way to specifying metadata for your controls&lt;BR&gt;b) DefaultInitializer that allows you to set properties when a control in instantiated from the Blend asset library&lt;BR&gt;c) Custom context menus&lt;BR&gt;d) An adorner for the control&lt;BR&gt;&lt;BR&gt;Let me know if you wanted some samples for any specific scenarios you might be interested in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://home.comcast.net/~unnir/images/Inker.jpg" mce_src="http://home.comcast.net/~unnir/images/Inker.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9515016" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/unnir/archive/tags/Blend+3/default.aspx">Blend 3</category><category domain="http://blogs.msdn.com/unnir/archive/tags/Extensibility/default.aspx">Extensibility</category></item><item><title>Writing a design time experience for a Silverlight control</title><link>http://blogs.msdn.com/unnir/archive/2009/03/22/writing-a-design-time-experience-for-a-silverlight-control.aspx</link><pubDate>Mon, 23 Mar 2009 01:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9499954</guid><dc:creator>unnir</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/unnir/comments/9499954.aspx</comments><wfw:commentRss>http://blogs.msdn.com/unnir/commentrss.aspx?PostID=9499954</wfw:commentRss><description>&lt;P&gt;Writing a design time experience for a Silverlight control can be a bit intimidating (the experience for WPF controls&amp;nbsp;remains unchanged from Blend 2 - just that you now have a ton more extensibility points - unless you wanted to re-use the same design-time code for the WPF and Silverlight versions of your controls). Let's try and understand how this works (because once you know the basics, its a breeze!).&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://home.comcast.net/~unnir/samples/SilverlightClassLibraryWithDesign.zip" mce_href="http://home.comcast.net/~unnir/samples/SilverlightClassLibraryWithDesign.zip"&gt;Here&lt;/A&gt; is a project template that will help you get started immediately. All you need to do to use this project template is to unzip the contents to a folder like C:\Users\&amp;lt;username&amp;gt;\Documents\Expression\Blend 3\ProjectTemplates. Also, sorry - I did not have time to create a VB version yet.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://home.comcast.net/~unnir/images/DialogForSLControlWithDesign.png" mce_src="http://home.comcast.net/~unnir/images/DialogForSLControlWithDesign.png"&gt;&lt;/P&gt;
&lt;P&gt;The project created from this&amp;nbsp;project template works as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Two control libraries are created each time you create and instance of the project template. For example, lets assume the the user chose the name "MySilverlightControl" as the name for the control library. The two libraries that are created are called MySilverlightControl.dll, and MySilverlightControl.Design.dll.&lt;/LI&gt;
&lt;LI&gt;The output path of MySilverlightControl.Design.csproj is set to copoy the library alongside MySilverlightControl.dll in a sub-folder called Design. This is identical to what you would do for a WPF control library - adding the design time library to a sub-folder prevents pollution of the "Add Reference" dialogs in the tools.&lt;/LI&gt;
&lt;LI&gt;MySilverlightControl.Design.csproj is basically a WPF control library project (all the user interface components for the design time experience and metadata that you will specify for the controls are&amp;nbsp;using the desktop CLR/WPF), and has the following:&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;A project-to-project reference to MySilverlightControl.csproj&lt;/LI&gt;
&lt;LI&gt;Because MySilverlightControl.csproj is&amp;nbsp;a Silverlight project (and because we want to use Silverlight types when we code the design time experience&amp;nbsp;- more on this shortly), we need to add a reference to the Silverlight&amp;nbsp;System.Windows.dll&lt;/LI&gt;
&lt;LI&gt;References to the two Blend 3 / VS Next shared&amp;nbsp;extensbility libraries - Microsoft.Windows.Design.Interaction.dll, and Microsoft.Windows.Design.Extensibility.dll. (&lt;STRONG&gt;Note&lt;/STRONG&gt;: In Blend 2/VS 2008, we also had Microsoft.Windows.Design.dll - the APIs in this dll have been moved into the other two libraries, and MWD.dll is no more)&lt;/LI&gt;
&lt;LI&gt;Because you have references to PresentationFramework.dll and System.Windows.dll, there is a conflict of types when you use a type like Button which exists in both. To help reslove this conflict for the compiler, we setup an alias for the Silverlight System.Windows.dll - TargetPlatform. Any type that is referenced using TargetPlatform::X.Y.Z is now resolved against the Silverlight assembly.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;For both WPF and Silverlight control libraries, while the way you specify the metadata tables is still compatible with VS 2008 / Blend 2, the registration mechanism has a breaking change. You now need to use an assembly level attribute - ProvideMetadata - for this. You can find an example for this in MetadataStore.cs in the MySilverlightControl.Design.csproj.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;While there are clear benefits to the approach we have chosen to support both WPF and Silverlight controls (same extensibility APIs so you don't have to learn two sets of APIs, ability to reuse the code for your design time experiences for WPF and Silverlight version of your controls by simply creating platform specific versions of the design time libraries), there are some pitfalls for advanced scenarios&amp;nbsp;that can be easily avoided:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There are breaking changes to the&amp;nbsp;APIs. Because Visual Studio 2008 SP1 GACs assemblies, unless you had a strong reference to the new assemblies, you might get compiler errors if the assemblies don't resolve to the new versions. Another option is to copy the assemblies locally into the project, and reference them from there. This&amp;nbsp;issue will be addressed in a more convenient fashion shortly.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;It is very easy to to unknowingly pass in a platform specific object (say System.Windows.Point) into an API (for example, the ModelItem ones to set values) where the platform is not compatible. This can be easily avoided by using aliasing appropriately.&lt;/LI&gt;
&lt;LI&gt;The .Net 3.5 SP1&amp;nbsp;WPF markup compiler (which comes into play when you try to define WPF UI for your desing-time - for example, a custom category layout for the property inspector or an adorner) does not play well with the aliasing system. To avoid this, consider separating the UI for the design time into a separate project that is a WPF only and has no references to the Silverlight assemblies.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Enjoy, and please do&amp;nbsp;let me know if you run into issues as you work with Silverlight design time experiences so we can address them.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9499954" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/unnir/archive/tags/Blend+3/default.aspx">Blend 3</category><category domain="http://blogs.msdn.com/unnir/archive/tags/Extensibility/default.aspx">Extensibility</category></item><item><title>Blend 3 Extensibility</title><link>http://blogs.msdn.com/unnir/archive/2009/03/17/blend-3-extensibility.aspx</link><pubDate>Wed, 18 Mar 2009 03:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9485345</guid><dc:creator>unnir</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/unnir/comments/9485345.aspx</comments><wfw:commentRss>http://blogs.msdn.com/unnir/commentrss.aspx?PostID=9485345</wfw:commentRss><description>&lt;P&gt;Based on popular customer feedback, we have added a number of new extensibility points in Blend 3 (sorry, no support for plugins, yet, but &lt;A class="" href="http://blogs.msdn.com/psiman/archive/2008/12/05/unify-for-expression-blend-2.aspx" mce_href="http://blogs.msdn.com/psiman/archive/2008/12/05/unify-for-expression-blend-2.aspx"&gt;who needs an officially supported extensibility model anyway&lt;/A&gt;? :) )&lt;/P&gt;
&lt;P&gt;Over the next few weeks, I will provide more information on these, including interesting use cases that are already starting to pop up. Here is a quick listing of what we currently support:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Project and item templates: We support the same formats as Visual Studio, with some very minor modifications to suite our user experience. User project and item templates can be copied into C:\users\username\Documents\Expression\Blend 3\ProjectTemplates and \ItemTemplates respectively. We do not support wizards yet.&lt;/LI&gt;
&lt;LI&gt;The Blend Asset Library&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Ability to register your custom controls. For example, to register a control library Foo.dll, all you need to do is to add the path to the control library as a value of the following registry key - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\v3.0\Toolbox\Silverlight\v3.0\MyCustomControlLibraryKey. If this were a WPF library, the key you would setup is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\v3.0\Toolbox\WPF\v3.5\MyCustomControlLibraryKey&lt;/LI&gt;
&lt;LI&gt;Adding an asset adds necessary assemblies to your project&lt;/LI&gt;
&lt;LI&gt;Support for custom control icons&lt;/LI&gt;
&lt;LI&gt;Setting custom properties on your control when they get instantiated - &lt;A class="" title="MSDN Link" href="http://msdn.microsoft.com/en-us/library/microsoft.windows.design.model.defaultinitializer.aspx" mce_href="http://msdn.microsoft.com/en-us/library/microsoft.windows.design.model.defaultinitializer.aspx"&gt;DefaultInitializer&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Design surface for custom controls&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Custom context menu commands&lt;/LI&gt;
&lt;LI&gt;Adorners&lt;/LI&gt;
&lt;LI&gt;Selection/object manipulation APIs&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Property grid extensibliity&amp;nbsp; - same support as Blend 2, with a few minor additions here and there&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Some other notes:&lt;/STRONG&gt;&lt;BR&gt;Blend 3 will share the same extensibility model as the next version of Visual Studio. &lt;/P&gt;
&lt;P&gt;As we live in a world where there is greater and greater parity between WPF and Silverlight, we wanted the same for these APIs wherein you could use the same design time code to target controls for both platforms. To accomodate this, we had to make some minor breaking changes to the VS 2008 APIs (hopefully the changes&amp;nbsp;will be very straightforward to adapt to) - I will try to post a number of samples to help out with this. By and large, the APIs remain the same as documented &lt;A class="" href="http://msdn.microsoft.com/en-us/library/bb546938.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb546938.aspx"&gt;here&lt;/A&gt; (the documentation will be updated to reflect the breaking changes&amp;nbsp;at a later date).&lt;/P&gt;
&lt;P&gt;The APIs are not final yet, and are subject to change. Hopefully, we can keep the changes to a minimum.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9485345" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/unnir/archive/tags/Blend/default.aspx">Blend</category><category domain="http://blogs.msdn.com/unnir/archive/tags/Extensibility/default.aspx">Extensibility</category></item></channel></rss>