Infragistics(R) NetAdvantage(R) WPF
About Saving and Loading Layouts
E-mail your feedback on this topic.

Glossary Item Box

This control is WPF Specific, for more information refer to the WPF Specific topic

The xamTilesControl™ allows your end users to move tiles, resize tiles, and change the state of tiles at run time. Your end users may expect you to save and load their changes between sessions so they do not have to reconfigure the xamTilesControl every time they restart your application. Fortunately, the xamTilesControl exposes a SaveLayout and a LoadLayout method that can help you achieve this scenario.

For example code on saving and loading layouts, install the NetAdvantage WPF feature browser. In the feature browser, you can search for "Saving and Loading Layouts" or you can expand the xamTilesControl node, then expand the "Layout and Behavior" node and then select the "Saving and Loading Layouts" sample.

Saving Layouts

In order to save a tile's state information in a layout, you must name the tile or set its SerializationId property to a unique string value. If you set both the Name and the SerializationId property, the SerializationId property takes precedence. The xamTilesControl offers four different ways to set a tile's serialization ID.

If you name a tile or supply a serialization ID but you do not want to save the tile, you can set its SaveInLayout property to False.

Loading Layouts

When you load a layout, xamTilesControl will automatically match the tile information found in the saved layout to an existing Tile object in its current layout. Then, it will raise the LoadingItemMapping event for each item in the saved layout. Handling this event gives you a chance to find out if the tile or item already exists in the current layout. If the item doesn't exist, you must create an appropriate item, set the LoadingItemMappingEventArgs object's Item property and add the item to xamTilesControl's Items collection (unbound scenario) or to your data source (data-bound scenario). If you do not supply an item in this event, xamTilesControl will skip the item.

The xamTilesControl will not remove tiles or items when you load a layout. If a tile or item exists in xamTilesControl's current layout but it does not exist in the saved layout, it will remain in the current layout.

Related Topics

About Tile Layout

Add Tiles to xamTilesControl

Retrieve a Reference to a Tile

Change the State of a Tile

About Tile Templates

Binding xamTilesControl to Data

Explicitly Arrange Tiles

Allow End Users to Close Tiles

Restrict a Tile's Size

Modify Tile Behaviors in Normal Mode

Modify Tile Behaviors in Maximized Mode

About Animations