Hi!
I'm currently working on a project and I need to ScaleTransform the SelectedItem
I've tried diffrent ways, but no ways seems to be.
What i want is the Image/CarouselItem/SelectedItem to Scale when i trigger StoryBoard begin.
Like a ZoomIn/ZoomOut on the SelectedItem.
Is this possible to do?
Regards
Joachim
I'm currently working on a project and I need to ScaleTransform the SelectedItem
I've tried diffrent ways, but no ways seems to be.
What i want is the Image/CarouselItem/SelectedItem to Scale when i trigger StoryBoard begin.
Like a ZoomIn/ZoomOut on the SelectedItem.
Is this possible to do?
TransformGroup transformGroup = (TransformGroup)SelectedItem.RenderTransform;
ScaleTransform transform = (ScaleTransform)transformGroup.Children[0];
xAni =
new
DoubleAnimation();
xAni.Duration = TimeSpan.FromMilliseconds(300);
xAni.From = xFrom;
xAni.To = xTo;
storyboard.Children.Add(xAni);
// if (yAni == null)
yAni =
new
DoubleAnimation();
yAni.Duration = TimeSpan.FromMilliseconds(300);
yAni.From = yFrom;
yAni.To = yTo;
storyboard.Children.Add(yAni);
Storyboard.SetTargetProperty(xAni,
new
PropertyPath(
"(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
));
Storyboard.SetTarget(xAni, SelectedItem);
Storyboard.SetTargetProperty(yAni,
new
PropertyPath(
"(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
));
Storyboard.SetTarget(yAni, SelectedItem);
storyboard.Begin();
<
telerik:RadCarousel
x:Name
=
"Part_RadCarousel"
AutoGenerateDataPresenters
=
"False"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Background
=
"Black"
VirtualizingStackPanel.IsVirtualizing
=
"True"
>
<
telerik:RadCarousel.ItemTemplate
>
<
ItemContainerTemplate
>
<
Image
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Margin
=
"25"
Height
=
"600"
Width
=
"800"
RenderTransformOrigin
=
"0.5,0.5"
Source
=
"{Binding ImageUrl}"
>
<
Image.RenderTransform
>
<
TransformGroup
>
<
ScaleTransform
ScaleX
=
"1"
ScaleY
=
"1"
/>
</
TransformGroup
>
</
Image.RenderTransform
>
</
Image
>
</
ItemContainerTemplate
>
</
telerik:RadCarousel.ItemTemplate
>
<
telerik:RadCarousel.ItemsPanel
>
<
ItemsPanelTemplate
>
<
telerik:RadCarouselPanel
Path
=
"{StaticResource path}"
IsContinuous
=
"True"
IsScalingEnabled
=
"True"
/>
</
ItemsPanelTemplate
>
</
telerik:RadCarousel.ItemsPanel
>
</
telerik:RadCarousel
>
Regards
Joachim