# WEBfactory 2010

Abstract

Check out these tutorials and learn how to use the WEBfactory2010 Project Upgrader tool by following the described steps.

Abstract

IMPORTANT:

Add the following DLL files from the Silverlight4/Standard folder to the project's folder, and reference them in the project:

• Microsoft.Expression.Controls.dll

• System.Reactive.dll

The following DLL files must be remove from the project's references:

• Telerik.Windows.Controls.RibbonBar.dll

The upgrade process is made automatically using WEBfactoryProject Upgrader Wizard, by changing the references to the actual versions.

WEBfactory Project Updater

To update a project to the desired version, follow the steps indicated by the WEBfactoryProject Upgrader Wizard:

1. Select the solution you want to upgrade. The original solution will not be changed, the upgrade being made after the solution is copied to the target location.

2. Select the target folder where the upgraded project will be copied - the folder must not exist on your machine, the WEBfactoryProject Upgrader will automatically create the folder. This is a security measure used to avoid overwriting existing files.

• To select the target folder, browse to the folder where you want the target folder to be created, select Ok and type the folder you want to create as target folder (see image above).

• The Full path of the upgraded solution box will display the full path of the solution.

3. Select the folder that contains the Silverlight controls to which you want to upgrade - the new version of Silverlight controls

If the folder that contains the Silverlight controls is located inside the project folder, the WEBfactoryProject Upgrader will set relative paths in the upgraded project, pointing to the Silverlight controls folder. This allows the user to move the project on another computer, without depending on a fixed path for the Silverlight controls folder.

If the folder that contains the Silverlight controls is located somewhere outside the project folder, the WEBfactoryProject Upgrader will set an absolute path pointing to he Silverlight controls folder. This makes the upgraded project to depend on the Silverlight controls folder location.

4. Click Next to continue. The next window will display a list of projects from the selected solution that will be upgraded.

5. Click Finish to start the process.

After the process is complete, the results are displayed:

• The projects with the status Success have been upgraded.

• The projects with the status Skipped are the web projects that don't have any reference to upgrade. This is not an error.

The complete solution with the upgraded references can be found in the target folder. The original solution is not affected by the upgrade process.

##### Upgrading Expression Blend/Visual Studio containing re-skinned controls to a newer WEBfactory version
Abstract

For this tutorial, the WEBfactory Demo Project will be used as example project.

In order to upgrade the solutions to a newer version of WEBfactory , the following steps need to be performed:

The following steps are available only for projects with re-skinned WEBfactory controls. Projects containing stock WEBfactory controls are upgraded using the WEBfactoryProject Upgrader only. The next steps are not necessary because the DialogControl, MessageBoxControl and WFWriteSecureDialog are not written in the XAML code.

For projects containing custom made controls, a different workflow is required:

• Clean and build the solution.

• Remove DialogControl, MessageBoxControl and WFWriteSecureDialog from the projects XAML. The Dialogs cannot be written in XAML code for the 3.3 version of WEBfactory .

• Check the dependencies after the above steps are complete. This is needed because some of the dependencies might be third party; the build might show no errors, but the control might not work properly at design time or run time.

Proceed with the next steps after the upgrade is complete.

###### Using Expression Blend
1. Open the upgraded project in Expression Blend. Right-click on the solution in the Projects panel and select Clean Project.

2. Right-click again on the solution and select Build Project. Alternatively, you can press F5 to start building the solution.

3. After the build succeeded, proceed to the next step.

If the solution you are upgrading contains incompatible code, the build will not succeed.

###### Using Visual Studio
1. Open the upgraded project in Visual Studio. Right-click on the solution in the Solution Explorer and select Clean Solution.

2. Right-click again on the solution and select Build Solution. Alternatively, you can press F6 to start building the solution.

3. After the build succeeded, proceed to the next step.

If the solution you are upgrading contains incompatible code, the build will not succeed.

###### Using Expression Blend

In order to successfully upgrade the project to the latest WEBfactory version, it is necessary to remove DialogControl, MessageBoxControl and WFWriteSecureDialog tags from each XAML file of the solution. For this, we will use the Find tool from Expression Blend (Edit > Find or Ctrl + F).

Using the Find tool to locate and delete the necessary tags

1. Using the Find in Files utility, all the XAML files form the project can be searched simultaneously. Use the Find in Files option and select XAML for the File Types. Apply the Find in Files on the entire solution.

2. The Find in Files results panel will list the found lines in all the XAML files. Double-clicking a result line in the results panel will open the XAML document containing the line and will set the cursor on that specific line.

In order to correctly remove the desire tags, make sure that the entire tag is deleted. In some situations, the tag may spread across multiple lines of code.

3. Repeat the procedure for all of the DialogControl, MessageBoxControl and WFWriteSecureDialog tags from all the XAML files from the solution.

###### Using Visual Studio

In order to successfully upgrade the project to the latest WEBfactory version, it is necessary to remove DialogControl, MessageBoxControl and WFWriteSecureDialog from each XAML file of the solution. For this, we will use the Find and Replace tool from Visual Studio.

Using the Find and Replace tool to locate and delete the necessary tags

1. Using the Find and Replace utility, all the XAML files form the project can be searched simultaneously. The easiest way is to use the Find in Files option and select the File Types that include XAML.

2. The Find Results panel will list the found lines in all the XAML files. Double-clicking a result line in the Find Results panel will open the XAML document containing the line and will set the cursor on that specific line.

In order to correctly remove the desire tags, make sure that the entire tag is deleted. In some situations, the tag may spread across multiple lines of code.

3. Repeat the procedure for all of the DialogControl, MessageBoxControl and WFWriteSecureDialog tags from all the XAML files from the solution.

###### Check the dependencies after the above steps are complete

This is needed because some of the dependencies might be third party; the build might show no errors, but the control might not work properly at design time or run time.

Please refer to the Controls and References documentation for checking the dependencies. Make sure that all the required dependencies are referenced in the project.

After the upgrading steps are complete, the solution can be opened in Expression Blend for testing. A correct upgrade procedure will result in a working Blend project. If any errors occur, check if all the tags were removed from all the XAML files in step 3.

##### Updating Expression Blend/Visual Studio projects with custom controls to a newer WEBfactory version
Abstract

Check out this article and learn how to update Expression Blend and Visual Studio projects with custom controls to a newer version.

When upgrading a project that contains custom controls/user controls to a new WEBfactory version, the custom controls/user controls must be edited in order to remove the DialogControl, MessageBoxControl and WFWriteSecureDialog from XAML and place it in the code source.

In order to upgrade the solutions to a new version of WEBfactory , the following steps need to be perfomed:

The following steps are available only for projects with custom controls and user controls. Projects containing stock WEBfactory controls are upgraded using the WEBfactoryProject Upgrader only. The next steps are not necessary because the DialogControl, MessageBoxControl and WFWriteSecureDialog are not written in the XAML code.

For projects containing re-skinned controls, a different workflow is required:

2. Clean and build the solution.

3. Remove DialogControl, MessageBoxControl and WFWriteSecureDialog from the projects XAML. The Dialogs cannot be written in XAML code for the 3.3 version of WEBfactory .

5. Check the dependencies after the above steps are complete. This is needed because some of the dependencies might be third party; the build might show no errors, but the control might not work properly at design time or run time.

Proceed with the next steps after the upgrade is complete.

###### Using Expression Blend
1. Open the upgraded project in Expression Blend. Right-click on the solution in the Projects panel and select Clean Project.

2. Right-click again on the solution and select Build Project. Alternatively, you can press F5 to start building the solution.

3. After the build succeeded, proceed to the next step.

If the solution you are upgrading contains incompatible code, the build will not succeed.

###### Using Visual Studio
1. Open the upgraded project in Visual Studio. Right-click on the solution in the Solution Explorer and select Clean Solution.

2. Right-click again on the solution and select Build Solution. Alternatively, you can press F6 to start building the solution.

3. After the build succeeded, proceed to the next step.

If the solution you are upgrading contains incompatible code, the build will not succeed.

###### Remove DialogControl, MessageBoxControl and WFWriteSecureDialog from the projects XAML.

The properties of the DialogControl, MessageBoxControl and WFWriteSecureDialog controls will be recreated in code source.

###### Using Expression Blend

In order to successfully upgrade the project to the latest WEBfactory version, it is necessary to remove DialogControl, MessageBoxControl and WFWriteSecureDialog tags from each XAML file of the solution. For this, we will use the Find tool from Expression Blend (Edit > Find or Ctrl + F).

Using the Find tool to locate and delete the necessary tags

1. Using the Find in Files utility, all the XAML files form the project can be searched simultaneously. Use the Find in Files option and select XAML for the File Types. Apply the Find in Files on the entire solution.

2. The Find in Files results panel will list the found lines in all the XAML files. Double-clicking a result line in the results panel will open the XAML document containing the line and will set the cursor on that specific line.

In order to correctly remove the desire tags, make sure that the entire tag is deleted. In some situations, the tag may spread across multiple lines of code.

3. Repeat the procedure for all of the DialogControl, MessageBoxControl and WFWriteSecureDialog tags from all the XAML files from the solution.

###### Using Visual Studio

In order to successfully upgrade the project to the latest WEBfactory version, it is necessary to remove DialogControl, MessageBoxControl and WFWriteSecureDialog from each XAML file of the solution. For this, we will use the Find and Replace tool from Visual Studio.

Using the Find and Replace tool to locate and delete the necessary tags

1. Using the Find and Replace utility, all the XAML files form the project can be searched simultaneously. The easiest way is to use the Find in Files option and select the File Types that include XAML.

2. The Find Results panel will list the found lines in all the XAML files. Double-clicking a result line in the Find Results panel will open the XAML document containing the line and will set the cursor on that specific line.

In order to correctly remove the desire tags, make sure that the entire tag is deleted. In some situations, the tag may spread across multiple lines of code.

3. Repeat the procedure for all of the DialogControl, MessageBoxControl and WFWriteSecureDialog tags from all the XAML files from the solution.

When the content of the window is defined in XAML, in order to proceed with the upgrading steps, the content needs to be extracted into a custom/user control. The custom/user control must be instanced in the code and referenced in the content property of the window.

Supposing that in the project XAML we use all of our removable controls (the DialogControl, MessageBoxControl and WFWriteSecureDialog). The tags that we removed in the third step (see above) would look like this:

<WFShared:DialogControl x:Name="DC1" Content="DialogControl" Width="100" Height="100" Grid.RowSpan="2" /> //for DialogControl
<WFShared:MessageBoxControl x:Name="MB1" Content="MessageBoxControl" Width="100" Height="100" Grid.RowSpan="2" /> //for MessageBoxControl
<WFShared:WFWriteSecureDialog x:Name="WSD1" Content="WFWriteSecureDialog" Width="100" Height="100" Grid.RowSpan="2" /> //for WFWriteSecureDialog

When working with user controls, the object can be created in the constructor. When working with custom controls, the object needs to be created in the OnApplyTemplate method!

Once the DialogControl, MessageBoxControl and WFWriteSecureDialog are removed from XAML, create the three objects in the code source:

1. Declare the objects:

	private DialogControl DC1; //for DialogControl

private MessageBoxControl MB1; //for MessageBoxControl

private WFWriteSecureDialog WSD1; //for WFWriteSecureDialog 
2. Create the objects in the constructor (for User Controls) or in the OnApplyTemplate method (for Custom Controls):

        CreateDialogControl(); //for DialogControl
	CreateMessageBoxControl (); //for MessageBoxControl
	CreateWFWriteSecureDialog (); //for WFWriteSecureDialog
3. Create the corresponding methods:

        private void CreateDialogControl() //for DialogControl
{
DC1 = new DialogControl();
DC1.Content = "DialogControl";
DC1.Width = 100;
DC1.Height = 100;
}

	private void MessageBoxControl() //for MessageBoxControl
{
MB1 = new DialogControl();
MB1.Content = "MessageBoxControl";
MB1.Width = 100;
MB1.Height = 100;
}

	private void WFWriteSecureDialog() //for WFWriteSecureDialog
{
WSD1 = new DialogControl();
WSD1.Content = "WFWriteSecureDialog";
WSD1.Width = 100;
WSD1.Height = 100;
}

###### Check the dependencies after the above steps are complete.

This is needed because some of the dependencies might be third party; the build might show no errors, but the control might not work properly at design time or run time.

Please refer to the Controls and References documentation for checking the dependencies. Make sure that all the required dependencies are referenced in the project.

After the upgrading steps are complete, the solution can be opened in Expression Blend for testing. A correct upgrade procedure will result in a working Blend project. If any errors occur, check if all the tags were removed from all the XAML files in step 3.

##### Upgrading Expression Blend/Visual Studio projects containing the User Manager control to a newer WEBfactory 2010 version
Abstract

Check out this article and learn how to upgrade Expression Blend and Visual Studio projects containing the User Manager control.

The upgrade of an Expression Blend (or Visual Studio) project that contains the WEBfactory User Manager control must be done in two steps:

To upgrade the project that contains the WEBfactory User Manager using the WEBfactoryProject Upgrader tool, click on the link below and follow the guide:

Once the upgrading procedure is complete, continue to the next step.