Anyone can give me some direction on how can I make the tile panel/container allow for variable height tiles? Ideally I would like to have variable heights and widths as show in the sample WPF app from here: http://blogs.infragistics.com/blogs/jason_beres/archive/2009/05/13/windows-azure-healthcare-mvvm-wpf-ado-net-data-services.aspx
However, I would be happy with having fixed width/columns (say two columns of equal width) but I really need to be able to have variable height; that is, two tiles in the same column can have different heights.
Thanks!
AP
Hi,Do you need something like this picture?Regars,Marin
Exactly like that...
Any help would be appreciated.
Thanks.
OK, It is not so simple and the solution has some limitations. In general you have to:1. To create a custom TilePane class2. To create a custom TilePanel class3. To edit a XamWebControl template and to replace TilePanel with the new panel4. To handle drag and drop operationsI will create several posts with sample code to help you.Regards,Marin
Thanks Marin,
I thought the solution would be along that path. I tried several things myself with TilePanel but I was unable to come up with anything close to what we need. We are currently evaluating the Silverlight toolkit for our product, and being able to have the variable height tiles is a must.
Looking forward to your sample code, I am sure it will be of great help!
Hello. Where can I download the solution for this post? I'm having similar problem. Thank you
Thanks Marin, this is very helpful.
I'll try putting the pieces together this afternoon.
It is all. I'm going to attach the full solution but right now I'm busy.This sample produces the following result:
4. Drag and DropDrag and Drop replaces positions of two tile and we need to recalculate offset and height factors:private void tv3_TileDragCompleted(object sender, TileDragCompletedEventArgs e){ MyTilePane tile1 = e.DragElement as MyTilePane; MyTilePane tile2 = e.TargetElement as MyTilePane; if (tile1 != null && tile2 != null) { double t; t = tile2.VerticalOffsetFactor; tile2.VerticalOffsetFactor = tile1.VerticalOffsetFactor; tile1.VerticalOffsetFactor = t; t = tile2.HeightFactor; tile2.HeightFactor = tile1.HeightFactor; tile1.HeightFactor = t; }}
3. XamWebTileView control templateOpen your page in Blend, edit the XamWebTileView template to create a new style and replace TilePanel with MyTilePanelthe original line is something like this: <igPrim:TilePanel x:Name="PagePanel" and the new line should be: <local:MyTilePanel x:Name="PagePanel" Finally your code will look like this:<igTV:XamWebTileView x:Name="tv3" RowsInPage="2" ColumnsInPage="3" Style="{StaticResource MyTileViewStyle}"TileDragCompleted="tv3_TileDragCompleted"><local:MyTilePane Header="1" Content="1" HeightFactor="0.5" VerticalOffsetFactor="0"/><local:MyTilePane Header="2" Content="2" HeightFactor="1.5" VerticalOffsetFactor="0"/><local:MyTilePane Header="4" Content="4" HeightFactor="0.5" VerticalOffsetFactor="0"/><local:MyTilePane Header="3" Content="3" HeightFactor="1.5" VerticalOffsetFactor="-0.5"/><local:MyTilePane Header="6" Content="6" HeightFactor="0.5" VerticalOffsetFactor="0.5"/><local:MyTilePane Header="5" Content="5" HeightFactor="1.5" VerticalOffsetFactor="-0.5"/></igTV:XamWebTileView>