I need to create a window in my WPF project in c# that contains a usercontrol that can be dragged and dropped
That window can contain any number of that user control depending upon the requirement and the placement of these user controls
should be such that each control are placed vertically below to each other and each user control can be minimized and can be reordered.
I am new to the infragistics and WPF can you please suggest how can this be achieved?
Thanks
Hello Richa,
Thank you for choosing Infragistics.
In order to move and drag & drop UserControls by using the XamTileManager, you can simply include a UserControl as Content for every XamTile.In addition, you can set different properties for the NormalModeSettings object and the MaximizedModeSettings object, which will allow you to adjust the way the tiles behave and get displayed.
View:
<ig:XamTileManager Name="tileManager" MaximizedTileLimit="3" TileCloseAction="RemoveItem"> <ig:XamTileManager.NormalModeSettings> <ig:NormalModeSettings TileLayoutOrder="Vertical" /> </ig:XamTileManager.NormalModeSettings> <ig:XamTileManager.MaximizedModeSettings> <ig:MaximizedModeSettings MaximizedTileLocation="Top" /> </ig:XamTileManager.MaximizedModeSettings> <!-- ============ Tiles with UserControls ============ --> <ig:XamTile Name="tile1" Header="Tile 01" CloseButtonVisibility="Visible" IsMaximized="False"> <local:UserControl1 /> </ig:XamTile> <ig:XamTile Name="tile2" Header="Tile 02" CloseButtonVisibility="Visible" IsMaximized="False"> <local:UserControl1 /> </ig:XamTile> <ig:XamTile Name="tile3" Header="Tile 03" CloseButtonVisibility="Visible" IsMaximized="False"> <local:UserControl1 /> </ig:XamTile></ig:XamTileManager>
<ig:XamTileManager.NormalModeSettings> <ig:NormalModeSettings TileLayoutOrder="Vertical" /> </ig:XamTileManager.NormalModeSettings>
<ig:XamTileManager.MaximizedModeSettings> <ig:MaximizedModeSettings MaximizedTileLocation="Top" /> </ig:XamTileManager.MaximizedModeSettings>
<!-- ============ Tiles with UserControls ============ --> <ig:XamTile Name="tile1" Header="Tile 01" CloseButtonVisibility="Visible" IsMaximized="False"> <local:UserControl1 /> </ig:XamTile>
<ig:XamTile Name="tile2" Header="Tile 02" CloseButtonVisibility="Visible" IsMaximized="False"> <local:UserControl1 /> </ig:XamTile>
<ig:XamTile Name="tile3" Header="Tile 03" CloseButtonVisibility="Visible" IsMaximized="False"> <local:UserControl1 /> </ig:XamTile></ig:XamTileManager>
I have attached a sample application that demonstrates the approach from above. For more details on the practical applications of the XamTileManager, I can suggest you take a look at the xamTileManager samples from our WPF Samples Browser.
If you have any questions, please let me know.
Hi
Thanks for your response.
Can you please confirm if XamTileManager control is supported in Infragistics v16.2?
Also, as per your sample code when I click on maximize button it expands that tile to the left side and remaining all tiles on the right side, but I want that when I click on maximize or rather when I click on header of any minimized tile it should get expand on its current location and all other tiles should get minimized vertically .
Suppose currently Tile 1 is maximized which is at the top and all other tiles are aligned vertically below to Tile 1, now if user clicks on Minimized tile 2 then Tile 1 should get minimized and Tile 2 should get Maximized at the same position(i.e. below Tile1), I don't want that maximized tile should come at the top or left rather it should remain on its same position, and other tiles should be in single row, can this be achieved using XamTileManager? If not, then can you please suggest any other control to achieve this?
Please refer below example:
Maximized Tile1
Minimized Tile2
Minimized Tile3
Minimized Tile4