XamTileView and XamTilesControl vs. XamTileManager

Atanas Dyulgerov / Thursday, November 10, 2011

The 11.2 release introduced a number of changes in the controls that comprise the product. Some controls have new features, others just work faster, smoother, better and a few controls are replaced all together. The Silverlight XamTileView and the WPF XamTilesControl are controls that got replaced by the cross platform XamTileManager. The new control is quite similar to the old ones but some differences exist. The most significant one is that the XamTileManager supports both WPF and Silverlight now. The XamTileManager is a port of the existing WPF XamTilesControl and therefore has all of its features. If you are unfamiliar with the old controls you can check this blog post for an overview of those features and example code on how to use some of them. Due to the limitations of the Silverlight platform following differences in the object model exist:

  • XamTileManager does not derive from our RecyclingItemsControl anymore but instead derives from Control and exposes a set of properties and methods that are similar to ItemsControl, e.g. ItemsSource, Items, ItemTemplate, ItemContainerStyle etc. This is done to facilitate the cross platform nature of the control.

  • The Tile class has been renamed to XamTile to improve the consistency.

  • Since SL doesn’t support property coercion XamTile’s State property is now read-only. However, XamTile exposes two properties that will affect state. They are IsMaximized and IsExpandedWhenMinimized.

  • In the existing WPF only tiles assembly, the panel we used was called TilesPanel. This has been renamed to TileAreaPanel and is now closely coupled with XamTileManager such that it will not work as a stand-alone panel. Therefore unlike TilesPanel its only use is inside the template of a XamTileManager.

  • All of the events are now CLR events, i.e. not routed events.

  • Since SL doesn’t support adding owner classes to properties, the following properties, which used to be defined both as attached properties on XamTilesControl and TilesPanel as well as direct properties on Tile, are now only exposed as attached properties on XamTileManager:

    • Column, ColumnSpan and ColumnWeight

    • Constraints, ConstraintsMaximized, ConstraintsMinimized and ConstraintsMinimizedExpanded

    • IsDragging and IsSwapTraget (read-only) properties

    • Row, RowSpan and RowWeight

    • SerializationId

  • Instead of exposing LoadLayout and SaveLayout methods on XamTileManager, the control implements this capability by taking advantage of our Persistence framework.

I hope this has been informative and useful. Have a great day.