Hi,
I am using XamTileManager. I want all the tiles to be in some default height and width. Then dynamically i can change the tile size. This is my requirement. But once i set the size, i won't be able to resize it. How to do it ?
I am attaching a sample which i used.
Hello Kumaran,
Thank you for your post. I have been reading through it and I can suggest handling the SizeChanged event of the XamTile in order to determine when the size of the tiles is changed. To do that you can create a style without key and add it to the Resources of your XamTileManager. Here is an example on how you can implement this approach:
Xaml:
... <ig:XamTileManager.Resources> <ig:TileConstraints x:Key="tileConst"></ig:TileConstraints> <Style TargetType="{x:Type ig:XamTile}"> <EventSetter Event="SizeChanged" Handler="Tile_SizeChaged"/> </Style> </ig:XamTileManager.Resources> ...
C#:
private void Tile_SizeChaged(object sender, SizeChangedEventArgs e) { //Implement your logic here. }
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hi Krasimir,
I tried what you specified in the above reply. But the event doesn't firing. I am attaching the modified sample. Please check...
Thank you for your feedback and the provided sample application. I have been looking into the sample application and it seems that the reason for the event to not fire is that the XamTiles does not actually change their size when dragging one of their sides. The reason for the XamTiles to not change their size is the code that you have added to the XamTileManager’s SizeChanged event. When you are setting the XamTile’s Width and Height explicitly, the resizing of the tile does not apply, since the Width and Height of the control are explicitly set. I can suggest instead of setting the Width and Height of each tile when the XamTileManager changes its size, to set the PreferredWidth
and PreferredHeight properties of the TileConstraints of the XamTileManager’s NodmalModeSetting property. I have modified the sample application that you have attached in order to demonstrates how you can implement this approach.
Thanks for your response. PreferredHeight & PreferredWidth property applies to all tiles. My scenario is, When loading the application each tile should be in different default size and each and every tile should be resizable. I can reduce or increase the size of a tile at any point of time while application runs.
HI,sorry for the late response from my side, but I can say that currently there is a way for setting PreferredHeight & PreferredWidth for each tile individually. This can be done with the attached property : <ig:XamTileManager.Constraints> for Normal mode. I'm attaching a sample that demostrates this functionality, and may be will be useful for you, I hope.
Regards,
Olga G.
Hi Olga,
Thanks for your response. Checked your sample and it works fine. I think, i can achieve my requirement using this way. Thanks for the solution.
Moreover, can you please check, is this possible to arrange tiles as shown in the below image
Hi, the approach that I have used in my example is to use TileLayoutOrder=HorizontalVariable for Normal mode.If you use TileLayoutOrder=UseExplicitRowColumnOnTile, and specify the exact row and column where the tile has to reside, also its RowSpan, ColumnSpan properties, you will achieve more accurate layout. All these are attached properties.
In this way you will have a better control over the tiles arrangement, and the tiles proportions. Note that you have to use property ExplicitLayoutTileSizeBehavior to define how this layout will be rearranged after you resize a tile.Please, refer to the documentation for XamTileManager to find more about different layouts for normal mode.
I'm a little bit confused about what you are trying to achieve. If your goal is the above layout, then I can try to provide you a simple sample. But you can play with these properties, check the documentation, and find some solution on your own.
I'm looking forward your replay.
Thank you,
I have been looking into Olga’s sample application and it seems that if you would like to resize the tiles when the ‘TileLayoutOrder’ property is set to “UseExplicitRowColumnOnTile”,you need not to set the ‘HorizontalAlignment’ and ‘VerticalAlignment’ properties of the tiles.
If you need any further assistance, feel free to ask.
The above image is just an sample of layout. Like i may need to layout the tiles in different way and that can be changed into any format and any size. When i use TileLayoutOrder=UseExplicitRowColumnOnTile then i can't resize any tile. But my requirement is, i have to allow the resizing feature with this different kind of layout.