Completed
Last Updated: 22 Dec 2017 14:26 by ADMIN
ADMIN
Dinko
Created on: 09 Feb 2017 13:59
Category: TileView
Type: Bug Report
11
TileView: Setting PreservePositionWhenMaximized property to true, leads to hiding of minimized tileview item during dragging or minimizing/maximizing operations
You can work this around by setting the PreservePositionWhenMaximized to False and implement custom preserving logic. You can see this approach in the attached project.

private bool isManualPositionChanged = false;
private Dictionary<RadTileViewItem, int> maximizedItemPositionCache = new Dictionary<RadTileViewItem, int>();

public MainWindow()
{
	InitializeComponent();
	this.xTileView.PreviewTileStateChanged += XTileView_PreviewTileStateChanged;
}

private void XTileView_PreviewTileStateChanged(object sender, Telerik.Windows.Controls.PreviewTileStateChangedEventArgs e)
{
	if (this.isManualPositionChanged)
            {
                return;
            }

            RadTileViewItem tileViewItem = (RadTileViewItem)e.OriginalSource;
            var header = tileViewItem.Header;
            TileViewItemState oldState = e.TileState;
            TileViewItemState newState = tileViewItem.TileState;

            if (newState == TileViewItemState.Minimized || newState == TileViewItemState.Restored)
            {
                if (maximizedItemPositionCache.ContainsKey(tileViewItem))
                {
                    this.isManualPositionChanged = true;
                    tileViewItem.Position = maximizedItemPositionCache[tileViewItem];
                    this.isManualPositionChanged = false;
                    maximizedItemPositionCache.Remove(tileViewItem);
                }
                if (newState == TileViewItemState.Restored)
                {
                    this.isManualPositionChanged = true;
                    var tileView = sender as RadTileView;
                    foreach (RadTileViewItem item in tileView.Items)
                    {
                        if (item.TileState == TileViewItemState.Maximized)
                        {
                            item.TileState = TileViewItemState.Restored;
                        }
                    }
                    this.isManualPositionChanged = false;
                }
            }
            else if (newState == TileViewItemState.Maximized)
            {
                if (!maximizedItemPositionCache.ContainsKey(tileViewItem))
                {
                    maximizedItemPositionCache[tileViewItem] = tileViewItem.Position;
                }
            }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
3 comments
ADMIN
Yoan
Posted on: 22 Dec 2017 14:26
The fix is available in LIB version 2017.3.1225, it will be also available in the R1 2018 Release.
ADMIN
Tanya
Posted on: 03 May 2017 08:29
Hi Timothy,

The status of the task is still "Approved". When the team starts working on this item, they will change the status to "In Development" and you will be notified for that change.

Regards,
Tanya
Tim
Posted on: 22 Feb 2017 14:15
Is there a status update on this bug?