I'm using the tile control, with its ItemsSource bound to a collection, how can i force one tile to be maximised when the control first loads/databinds?
<igTiles:XamTilesControl Width="Auto" ItemsSource="{Binding Path='Entity.EntityAddresses'}" HeaderPath="AddressType.sDescription" LoadingItemMapping="XamTilesControl_LoadingItemMapping"> <igTiles:XamTilesControl.NormalModeSettings> <igTiles:NormalModeSettings AllowTileSizing="No" /> </igTiles:XamTilesControl.NormalModeSettings> <igTiles:XamTilesControl.MaximizedModeSettings> <igTiles:MaximizedModeSettings ShowTileAreaSplitter="False" AllowTileDragging="No" MinimizedTileExpansionMode="AllowMultipleExpandAllInitially" MinimizedTileExpandButtonVisibility="Hidden" VerticalTileAreaAlignment="Top" MaximizedTileLayoutOrder="VerticalWithLastTileFill" MaximizedTileLocation="Right" ShowAllMinimizedTiles="True"> <igTiles:MaximizedModeSettings.MinimizedExpandedTileConstraints> <igTiles:TileConstraints MaxWidth="200" MinWidth="80" PreferredWidth="120" PreferredHeight="90" MinHeight="60" MaxHeight="70" /> </igTiles:MaximizedModeSettings.MinimizedExpandedTileConstraints> </igTiles:MaximizedModeSettings> </igTiles:XamTilesControl.MaximizedModeSettings> <igTiles:XamTilesControl.ItemTemplateMaximized> <DataTemplate> <my:uscAddressReadOnly DataContext="{Binding Path='Address'}"/> </DataTemplate> </igTiles:XamTilesControl.ItemTemplateMaximized> </igTiles:XamTilesControl>
Hello Edward,
You can use the Loaded event to maximize a tile using this code into it:
XamTileControl.TileFromItem(XamTileControl.Items[tileToMaximize]).State = State.Maximized;
Hope this helps
Horen Kirazyan
Thanks for your responce, your suggested solution works very well, but i would be interested to know if this is someting that can be achieved through the use of a DataTrigger?
Hi Edward,
You might be able to set the State with a DataTrigger but if is is just for initialization then doing it in the Loaded event is probably better.
The DataTrigger approach has some drawbacks since it could end up fighting explicit settings, e.g. if the user un-maximizes the tile. If you aren't allowing the user to un-maximize the tile (or maximize a different tile) then that should not be an issue.