Infragistics® WPF 2016.1
Allow End Users to Close Tiles

You can allow your end users to close tiles by setting the TileCloseAction property exposed by xamTileManager or the CloseAction property exposed by a XamTile object. The CloseAction property of a XamTile object will override the TileCloseAction property of the xamTileManager. If you set the TileCloseAction property or CloseAction property to RemoveItem, xamTileManager will attempt to remove the item from its Items collection (unbound scenario) or the underlying data source (data-bound scenario). If the collection does not support removal, xamTileManager will hide the tile instead.

If you want to allow your end users to re-open closed tiles, you must provide a way to do it. For example code on re-opening closed tiles look at the "Tile Closing Actions" sample in the xamTileManager samples.

Finally, each XamTile object also exposes a CloseButtonVisibility property that you can set to hide the close button. However, setting the CloseAction property will automatically toggle the close button's visibility.

The following example code demonstrates how to allow end users to close tiles.


<ig:XamTileManager Name="xamTileManager1" TileCloseAction="CollapseTile">
    <ig:XamTile Header="Tile 1" />
    <ig:XamTile Header="Tile 2" />
    <ig:XamTile Header="Tile 3" CloseAction="DoNothing" />

In Visual Basic:

Imports Infragistics.Controls.Layouts
Me.xamTileManager1.TileCloseAction = TileCloseAction.CollapseTile

Dim nonClosableTile As Tile = _

If nonClosableTile IsNot Nothing Then
    nonClosableTile.CloseAction = TileCloseAction.DoNothing
End If

In C#:

using Infragistics.Controls.Layouts;
this.xamTileManager1.TileCloseAction = TileCloseAction.CollapseTile;

XamTile nonClosableTile =
if (nonClosableTile != null)
    nonClosableTile.CloseAction = TileCloseAction.DoNothing;
Related Topics

About Tile Layout

Add Tiles to xamTileManager

Retrieve a Reference to a Tile

Change the State of a Tile

About Saving and Loading Layouts

About Tile Templates

Binding xamTileManager to Data

Explicitly Arrange Tiles

Restrict a XamTile's Size

Modify Tile Behaviors in Normal Mode

Modify Tile Behaviors in Maximized Mode

About Animations



Copyright © 2008-2016 Infragistics, Inc. All rights reserved.

E-mail your feedback on this topic.