Hello Simon,
Thank you for writing.
Note that
RadPanorama uses its
TileDragDropService to perform drag and drop operation. In the TileDragDropService.
PrepareContext method,
AnimatedPropertySetting is applied to the tiles manipulating the offset and the scale transform. You can prevent this functionality by using a custom
TileDragDropService. You should suspend animations of
RadPanorama as well:
public
Form1()
{
InitializeComponent();
this
.radPanorama1.PanoramaElement.ElementTree.SuspendAnimations();
this
.radPanorama1.PanoramaElement.DragDropService =
new
CustomTileDragDropService(
this
.radPanorama1.PanoramaElement);
}
public
class
CustomTileDragDropService : TileDragDropService
{
private
RadPanoramaElement owner;
public
CustomTileDragDropService(RadPanoramaElement owner) :
base
(owner)
{
this
.owner = owner;
}
protected
override
bool
PrepareContext()
{
zoomedOutTiles =
true
;
return
base
.PrepareContext();
}
protected
override
void
HandleMouseMove(Point mousePos)
{
base
.HandleMouseMove(mousePos);
ZoomInTiles();
//do not scale tiles
//stop position offset of hovered tiles
Point clientPoint =
this
.owner.PointFromScreen(mousePos);
RadTileElement source = (
this
.Context
as
RadTileElement);
if
(source ==
null
)
{
return
;
}
TileGroupElement targetGroup =
this
.GetTargetGroup(
new
RectangleF(clientPoint, source.Size));
if
(targetGroup ==
null
)
{
return
;
}
Point targetCell =
this
.GetTargetCell(targetGroup, clientPoint);
if
(targetCell.X == -1)
{
return
;
}
foreach
(RadTileElement tile
in
targetGroup.Items)
{
tile.PositionOffset =
new
SizeF(0, 0);
}
}
protected
override
void
PerformStop()
{
base
.PerformStop();
zoomedOutTiles =
false
;
}
bool
zoomedOutTiles =
false
;
private
IEnumerable GetTiles()
{
if
(
this
.owner.ShowGroups)
{
ArrayList tiles =
new
ArrayList();
foreach
(TileGroupElement group
in
this
.owner.Groups)
{
foreach
(RadTileElement tile
in
group.Items)
{
tiles.Add(tile);
}
}
return
tiles;
}
else
{
return
this
.owner.Items.ToArray();
}
}
private
void
ZoomInTiles()
{
if
(!
this
.zoomedOutTiles)
{
return
;
}
AnimatedPropertySetting offsetAnimation =
new
AnimatedPropertySetting(GridLayout.CellPaddingProperty,
new
Padding(10),
new
Padding(5),
3, 25);
offsetAnimation.RemoveAfterApply =
true
;
foreach
(RadTileElement tile
in
this
.GetTiles())
{
AnimatedPropertySetting scaleAnimation =
new
AnimatedPropertySetting(RadElement.ScaleTransformProperty,
tile.ScaleTransform,
new
SizeF(1, 1),
3, 25);
scaleAnimation.RemoveAfterApply =
true
;
if
(tile !=
this
.Context)
{
scaleAnimation.ApplyValue(tile);
offsetAnimation.ApplyValue(tile);
}
}
this
.zoomedOutTiles =
false
;
}
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the
Telerik Feedback Portal and vote to affect the priority of the items