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.
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.
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,
Olga G.
Hi Olga,
Analyzed your solution. It is working fine. Once the TileConstraints set for a tile, then it can't be changed. But my requirement is, after resizing a tile, the new tile should be in some fixed proportion. For example,
In tile manager, i have five columns. A tile should be 1X, 2X, 3X, 4X or 5X ( X - One Column size). So when resizing a tile, i have to make the new size in the multiples of X. I tried this using TileConstraints. But it was not working. How can i achieve this ?
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