XAML Power Toys 2008 Current Version 22.214.171.124, Last Update 13 February 2010
XAML Power Toys 2010 Current Version 126.96.36.199, Last Update 7 July 2010
XAML Power Toys for Visual Studio 2008 and Visual Studio 2010
Table Of Contents
- Additions and fixes in this release
- Feature Set
- Screen Shots
- Creating Business Forms, ListViews and DataGrids
- Cool Usage Tip
XAML Power Toys is a Visual Studio 2008 SP1 Add-In or a Visual Studio 2010 Add-In that empowers WPF & Silverlight developers while working in the XAML editor. Its Line of Business form generation tools, Grid tools, DataForm, DataGrid and ListView generation really shorten the XAML form layout time.
XAML Power Toys commands are accessed using the XAML editor context menu and code editor context menu.
XAML Power Toys 2008 generates .NET 3.5 SP1 WPF compliant XAML and Silverlight 3 compliant XAML.
XAML Power Toys 2010 generates .NET 4.0 WPF compliant XAML and Silverlight 4 compliant XAML.
- Visual Studio 2008 with SP1 or Visual Studio 2010 Release Candidate version or later
- For Silverlight Development, install the latest Silverlight 3 as detailed on http://www.silverlight.net/getstarted/ (If you’re not doing Silverlight development this is not required.)
- For Silverlight DataForm development, must install the Silverlight Toolkit.
- x32 or x64 operating system
- Windows XP, Vista, Windows 7, Server 2003 or Server 2008
- Added support for Silverlight 4
- Corrected ViewModel creator spit
- If you remove the CommandParameter type in the Command Creation Window, the spit will no longer add the CommandParameter type to the RelayCommand or DelegateCommand, to the methods or lambda’s.
- If you specify a CommandParameter type in the Command Creation Window, the spit will add the CommandParameter type to the RelayCommand<T> or DelegateCommand<T>, to the methods and lambda’s.
- Fixed the property discovery of model objects to add all public properties of all base types.
- Create ViewModel Class - from a VB.NET or C# code window, easily create a ViewModel stub that includes commands and exposed data class. Optionally you can elect to re-implement all Model properties on the ViewModel.
- Create Silverlight DataForm For Selected Class - quickly create a DataForm complete with bindings that are easily associated with properties on the source class
- Create WPF or Silverlight DataGrid For Selected Class - quickly create a DataGrid complete with bindings that are easily associated with properties on the source class
- Create WPF ListView For Selected Class – quickly create a ListView complete with bindings that are easily associated with properties on the source class
- Create Business Form For Selected Class – quickly create a form complete with bindings that are easily associated with properties on the source class
- Create Business Form – quickly create a form without selecting an entity class. Great for creating unbound forms or just laying out a Grid.
- Show Fields List For Selected Class – display a list of class fields similar to Microsoft Access. Allows dragging of fields to create controls
- Extract Properties To Style – allows selecting a control, choosing desired properties and have those selected properties extracted to a newly created style
- Group Into – allows selecting one or more controls and group them inside a new parent control. Many options provided
- Change Grid To Flow Layout – allows selecting of one of more control and will remove all MinWidth, MinHeight, Margin properties and will set all row and column definitions to Auto.
- Chainsaw Minimize Cider Designer XAML – allows selecting of one or more controls and will remove all MinWidth, MinHeight, x:Name, Name, Margin properties and will set all row and column definitions to Auto.
- Remove Margins – allows selecting one or more controls and removes the Margin property from them
- Edit Grid Column and Rows – allows selecting a grid and then add or remove rows and columns
- Set Defaults For Created Controls – allows customizing the initial properties that are set when the software creates a new control
- About Box – see the version of XAML Power Toys installed on your system. The current version of XAML Power Toys is always displayed at the top of this page below the title.
XAML Editor Content Menu
VB.NET and C# Code Window Content Menu
Select Class Using Class Picker
The "Create Form, ListView or DataGrid From Selected Class" and "Fields List From Selected Class" XAML Editor commands both open this class picker form. This form displays the current project and all referenced projects and referenced assemblies except Microsoft assemblies. After selecting the class you press the "Next…" button and you’ll be taken to the appropriate form.
The TreeView is grouped by assembly, namespace and then the classes are sorted by name.
Create Business Form, DataGrid, ListView or DataForm For A Class
This form is drag and drop enabled. Also features a contracted view of fields.
Allows setting required properties. Data binding validation and other properties are determined from your default control settings.
Makes selecting a StringFormat very easy. Displays the format string and example side by side.
Create Business Form
This was a version one feature. Allows creating a form when not class is available. Great for roughing out Grids and populating with controls.
Similar to the Microsoft Access Fields List, this allows dragging a field to the XAML Editor and the field and/or label control will be created for you, with all data bindings set for the property. This floats on top of Visual Studio and you can collapse it. The fields list is a great tool when you need to add a new field to an existing layout.
The ViewModel creator tool makes building a ViewModel class a snap. This feature is sensitive to C# and VB.NET and will create the correct code for you.
The yellow highlight indicates the new feature added in v188.8.131.52. You can now select or type in the name of the method that will be called when raising a PropertyChanged event.
This name value is also used if you selected the Implement INotifyPropertyChanged option.
This name feature enables you to use any name in your ViewModel base classes and have the generated code us it.
XAML Power Toys allows developers to determine how controls are created by the software. The developer can describe how each platforms controls are rendered. Developers can determine which data binding validation properties are set automatically and exactly which properties are set when the control is created. In the below example, I have set the WPF TextBox to have the HorizontalAlignment and VerticalAlignment properties set.
Note: The below ForceReRead converter is not required for .NET 4.0. I have removed the ForceReRead converter from the Visual Studio 2010 version.
ForceReRead Converter – VB.NET & C# converters included in source and binary downloads. Converter is also included in the OceanFramework.WPF namespace.
The ForceReRead converter is discussed in this MSDN Form Post. This converter is necessary for TextBox bindings where the Source property "could" be changing the property in the Setter. Example, the user enters "wa" in the TextBox. The Source property State Setter is called and "wa" passed. The State Setter then sets the Value to WA. Without this converter, the data binding pipeline will not re-read the property and display the new "WA" value in the TextBox. With the converter, "WA" is displayed in the TextBox.
The ForceReRead converter is not added if the TextBox.Text binding has the StringFormat property is set because it is not needed. If you edit the generated TextBox.Text binding and need to add another converter to your code instead of the ForceReRead converter your converter will force the value to be re-read by the data binding pipeline.
The ForecedReRead converter is not required for .NET 4.0. You can read about the new .NET 4.0 feature here: http://karlshifflett.wordpress.com/2009/05/27/wpf-4-0-data-binding-change-great-feature/
TargetNullValue is supported in WPF and Silverlight 4.
TargetNullValue – when TextBox.Text property is data bound to a Nullable Source, setting the TargetNullValue=” will allow the Source property to be set to Nothing (null) without generating a binding exception. Without this property a converter would be required to set the value to Nothing (null). This enables an empty string in a TextBox to correctly set the Source to Nothing (null).
The below image shows the setup for the Silverlight DataGrid control.
The imported name space is "sdk" and the Control Type is entered as "sdk:DataGrid"
I’m begging every developer in the strongest possible terms, please view the below videos. They will get you up and running and productive in a very short time.
Videos are now hosted on Vimeo. You can read about the cool feature provided by Vimeo here.
If you’re reading this and have not watched the above videos, please do so now (thank you!) . I won’t be repeating the content of the videos below. They are short and to the point. You’ll be up and running, saving lots of time in just a few minutes.
I’m supplying the source code for those who have authored Visual Studio Add-In’s or who want to look under the covers. Visual Studio Add-In’s are not the difficult to write, but there is a new programming API to learn.
The XAML Power Toys UI is WPF which made the coding very easy. There is one hurtle I had to get past. The XAML Power Toys Add-In does not program against any object model, it is really just manipulating text. There is no object model available in Visual Studio Add-In’s to program against which is why the Add-In has the developer selecting text in the XAML editor. The add-in then processes that selected text. The Grid Row and Column Editor does some pretty slick stuff, all without any real object model to program against. This was my first crack and working with the XMLDocument so any feedback on better techniques will be well received.
I want to emphasize a requirement when creating forms, ListViews, DataForms or DataGrids for a class. You must ensure that the solution has been built. If you make any changes to the source class that you want to make a form for, you must rebuild the project so that the add-in can property reflect the properties of the source class.
Ensure that you have installed Visual Studio 2008 SP1.
For Silverlight Development, install the latest Silverlight 3 as detailed on http://www.silverlight.net/getstarted/ (If you’re not doing Silverlight development this is not required.)
For Silverlight DataForm development, must install the Silverlight Toolkit.
Run the downloaded Setup.exe.
XAML Power Toys 2008 will be available in Visual Studio 2008.
Ensure that you have installed Visual Studio 2010 RTM or later version.
For Silverlight Development, install the latest Silverlight 4 as detailed on http://www.silverlight.net/getstarted/ (If you’re not doing Silverlight development this is not required.)
For Silverlight DataForm development, must install the Silverlight Toolkit.
Run the downloaded Setup.exe.
XAML Power Toys 2010 will be available in Visual Studio 2010.
First Time Use
The first time you use XAML Power Toys please edit and save your Control Default Settings.
If you do not do this, and you access a feature that needs them, default settings will be created, saved and a dialog box will display, informing you of the action just taken. By editing and saving your Control Default Settings before using XAML Power Toys, you’ll not only avoid this intrusive dialog box, but you’ll know and can control how controls are created by XAML Power Toys.
Control Default Settings are now being saved in the
VS 2008: C:\Users\<YOUR USER NAME>\AppData\Roaming\Little Richie Software\XAML Power Toys
VS 2010: C:\Users\<YOUR USER NAME>\AppData\Roaming\Little Richie Software\XAML Power Toys 2010.
These are system folders for saving program data files like the settings file.
Remember – Please build your projects before attempting to create forms, ViewModels or using the Field List.
Please set your Control Defaults after installing, new options have been added.
Download now comes from my Windows Live Sky Drive pages. The two below links will take you to a page where you can download the installer and/or the source.
I have written a blog post on how to select large amounts of XAML when performing a Group Into. The blog post is Cool Usage Tip For XAML Power Toys. Check it out and easily select large amounts of XAML when Grouping or working with Grids.
Here is a follow up blog post that provides another solution to selecting large portions of XAML: Super Tip For XAML Power Toys
Future of XAML Power Toys
Please post your comments, complaints and suggestions on this blog post.
XAML Power Toys uses the Mono.Cecil library for reflection. Mono.Cecil uses the MIT X11 License. XAML Power Toys is adopting the same license as Mono.Cecil.
Copyright (c) 2009 Little Richie Software
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Have a great day.
Just a grain of sand on the worlds beaches.