Hello,
Is there a possibility to add functionality for double click on the tilepane header? I want the TilePane thats double clicked to become maximized, or when it's maximized it should become normal.
Thanks in advance,
Arjan
Hi Arjan,You need to detect a double click and then change the tile state.For example:public class Tile : TilePane{ private DateTime _clickTime = DateTime.Now; private int _dblclickInterval = 444; private bool _lastClickIsDoubleClick; protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); TimeSpan deltaT = DateTime.Now - _clickTime; if (deltaT.TotalMilliseconds < _dblclickInterval && !this._lastClickIsDoubleClick) { this.TileState = this.TileState == TileState.Maximized ? TileState.Normal : TileState.Maximized; _lastClickIsDoubleClick = true; } else _lastClickIsDoubleClick = false; _clickTime = DateTime.Now; }}Regards,Marin
Hello Marin,
Thanks for your suggestion. But when the TileState = Maximized the event is not triggered so the TileState stays maximized. Do you have any clue on this?
Thanx,
Hi Arjan,Could you put more details? I'm using VS2010 and SL4 and this sample works fine:<Grid x:Name="LayoutRoot"><igTV:XamWebTileView Name="xamWebTileView1" RowsInPage="2" ColumnsInPage="2"> <local:Tile Header="Tile 1" Content="Tile 1"/> <local:Tile Header="Tile 2" Content="Tile 2"/> <local:Tile Header="Tile 3" Content="Tile 3"/> <local:Tile Header="Tile 4" Content="Tile 4"/></igTV:XamWebTileView></Grid>Regards,Marin
I'm using VS2008 SL3 and ig2010.1.I've also used your example on variable width/height:https://ko.infragistics.com/community/forums/f/retired-products-and-controls/38792/variable-height-width-tiles
<
igTV:XamWebTileView x:Name="TileView" Regions:RegionManager.RegionName="TilePaneRegion" LayoutUpdated="TileView_LayoutUpdated" Style="{StaticResource MijnPTileView}" ColumnsInPage="2" RowsInPage="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" TileDragCompleted="TileView_TileDragCompleted"><base:BaseTilePane x:Name="AnalysePane" Header="Analyse" Style="{StaticResource MijnPTilePane}" SizeChanged="AnalysePane_SizeChanged" HeightFactor="1.5" VerticalOffsetFactor="0"><Grid Regions:RegionManager.RegionName="AnalyseMasterRegion" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/></base:BaseTilePane><base:BaseTilePane x:Name="RelationPane" Header="Relation" Style="{StaticResource MijnPTilePane}" SizeChanged="RelationPane_SizeChanged" HeightFactor="1.5" VerticalOffsetFactor="0"><Grid Regions:RegionManager.RegionName="RelationMasterRegion" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/></base:BaseTilePane><base:BaseTilePane x:Name="GroupPane" Header="Group" Style="{StaticResource MijnPTilePane}" SizeChanged="GroupPane_SizeChanged" HeightFactor="0.5" erticalOffsetFactor="0.5"><Grid Regions:RegionManager.RegionName="GroupMasterRegion" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/></base:BaseTilePane><base:BaseTilePane x:Name="DetailPane" Header="Detail" Style="{StaticResource MijnPTilePane}" SizeChanged="DetailPane_SizeChanged" HeightFactor="0.5" VerticalOffsetFactor="0.5"><Grid Regions:RegionManager.RegionName="DetailMasterRegion" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/></base:BaseTilePane></igTV:XamWebTileView>
Probably it is not important but there are some errors in XAML - HeightFactor="0.5" erticalOffsetFactor="0.5
Thanx Marin,
This works exactly like I want it to.
Hi Arjan,It is possible to use both DragDropManager and DoubleClick.There is some conflict when dragging a control and the control captures the mouse. We are going to improve this in the next service release.Add this code to the Tile class to allow DoubleClick and DragDropManager:protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e){ base.OnMouseLeftButtonUp(e); this.CheckForDoubleClick(e); this.ReleaseMouseCapture();}protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e){ base.OnMouseLeftButtonDown(e); if (this.TileState != TileState.Normal && this.IsMouseOverheader(e)) this.CaptureMouse();}Regards,Marin
I like this. The user will not worry about the mouse position ;)Add this code to the OnMouseLeftButtonUp method:base.OnMouseLeftButtonUp(e);ContentPresenter cp = this.GetTemplateChild("headerContentPresenter") as ContentPresenter;Point p = e.GetPosition(this);if(p.Y > cp.ActualHeight) return; Regards,Marin
After further investigation I found out that the problem arises when there is a combination of DoubleClick and adding DragDropManager on a TilePane, so I guess I have to choose which one of them I want to use? A combination is not possible?
Got it working now, thanx. Started over again and now it seems fine. One more question however, now the TileState changes no mather where I double click in the tilepane. Is it possible to do this only on the header?