Pinned and Unpinned Elements

ComponentOne XapOptimizer performs a dependency analysis and automatically detects elements that can be pruned from the application. This automatic analysis works in most cases, but sometimes you may want to exclude additional elements from the pruning process. To do this, you should "pin" the elements that you want to keep in the application.

Pinned and unpinned elements in the element tree appear in differing fonts and with icons to distinguish them. Elements appear similar to items in the following table:

 

Image

Type

Description

Pinned.

Pinned elements will not be pruned because they are marked to stay in an assembly. When you pin an element, all elements used by that element also stay in the assembly. If you pin an element with subelements, all subelements are pinned. You can expand the item and pin or unpin subelements manually, as well.

Partially pinned.

Partially pinned elements are elements with subelements, some of which have been pinned, and some which have not been pinned.

Will be pruned.

Grayed out elements will be pruned because XapOptimizer could not find any dependency to those elements. You can avoid this by pinning items manually.

Will not be pruned.

Items that appear in a normal font will not be pruned and will stay in the final assembly after optimization.

Cannot be pruned.

Some items cannot be pruned at all, due to limitations (for example, if they are part of the Silverlight core). Items that cannot be pruned will appear in a normal font. The top level project assembly pictured to the left, for example, cannot be pruned.

 

Pinning Elements

To pin an element, complete the following steps:

1.   Expand nodes in the element tree and locate the item you wish to pin.

Note that only grayed out elements (items that would normally be pruned) can be pinned.

2.   Click the Pin icon next to the item you wish to include. The item will be pinned and will no longer appear grayed out. If you pin an element with subelements, all subelements will be pinned.

Note that you can also pin elements by pressing the SPACEBAR key when navigating the tree with the keyboard. Note that you can now pin entire assemblies, namespaces, and resources.

Unpinning Elements

To unpin a pinned element, complete the following steps:

1.   Expand nodes in the element tree and locate the item you wish to unpin.

Note that only pinned elements can be unpinned.

2.   Click the Pin icon next to the item you wish to no longer include. The item will be unpinned and will appear grayed out. If you unpin an element with subelements, all subelements will be unpinned.

Note that you can also unpin elements by pressing the SPACEBAR key when navigating the tree with the keyboard.

Resetting Pinned Items

If you need to, you can reset pinned and unpinned items. Click the Reset button to return to the default settings. Note that you will lose any changes that you have made.

Note that all elements defined in the main application assembly are kept in the final application. The pruning process is only applied to auxiliary assemblies included in the application, which are often libraries.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.