I have created a ControlTemplate like this:
<
ControlTemplate
x:Key
=
"RadWindowTemplate"
TargetType
=
"Controls:RadWindow"
>
<
telerik:RadTransitionControl
Content
=
"{TemplateBinding Content}"
>
<
telerik:RadTransitionControl.Transition
>
<
telerikTransition:FadeTransition
/>
</
telerik:RadTransitionControl.Transition
>
</
telerik:RadTransitionControl
>
</
ControlTemplate
>
When I create a new RadWindow and set its Template property to template above, the window becames borderless, it means, it loses its header and buttons.
Am I doing this by the right way??
Thanks
5 Answers, 1 is accepted
I believe you want to use the RadTransitionControl to create animation for the RadWindow when it shows or hide. You can not use the RadTransitionControl for that purpose. Are you trying to make the window use fade animation instead of the default zoom?
Best wishes,
Pana
the Telerik team
Really, I want to animate the change of the content of the RadWindow (e.g.: my RadWindow has a RadGrid. When I double click a record, I change the RadWindow's content to show the details of the record). Otherwise, I have already put a ContentControl as the RadWindow content e change the TransitionControl's binding to this ContentControl. Like this, all works fine.
Thanks,
Ah, I am glad you have figured it out. If you want to animate the change of content in the window it is enough indeed to put RadTransitionControl as Content of the RadWindow and instead of setting the Content of the RadWindow you can set the Content of the RadTransitionControl.
You can use the RadWindow's Template property to change its ContentTemplate but in that case you will have to include the default ContentTemplate (which is a lot of xaml and it is missing in the code you have posted) and replace the ContentPresenter within with the RadTransitionControl.
All the best,
Pana
the Telerik team
So there is not away to apply transitions to the RadWindow Show/Hide events using the RadTransistion control then? I was hoping you were going to make it simple on me. :)
If this has changed in a newer version care to elighten me on how to apply this feature to a RadWindow?
Thanks,
Garry
The TransitionControl is meant to provide visual effects when its content is changes and not to trigger some animations for showing/hiding something. In order to customize the Show/Hide animations of the RadWindow control you need to change the AnimationManager.AnimationSelector attached property of the RadWindow control. Its animations are called Show and Hide and this could be achieved in a way, similar to the one it is explained in this article about menu animations. Another approach could be to set the AnimationSelector to be null and add animations with Storyboards like described here. Please notice that as this article is pretty old you shouldn't use the Opened event, but the Loaded event of the RadWindow control to run the open animation.
Hope this helps.
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>