This is a migrated thread and some comments may be shown as answers.

Disable Animation on OnApplyTemplate

3 Answers 80 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 31 May 2016, 01:41 PM

Hi everyone,

I am currently creating a control syncing a RadScheduleView with RadTimeBar and RadCalendar.

The controls are pretty great, and everthing works so far, but I have one problem on the UI itself :

The RadCalendar is using a DayTemplateSelector to mark days corresponding to appointements in the RadScheduleView, and when these appointements are being edited, I use

calendar.OnApplyTemplate()
to refresh properly.

The data itself is ok, but each time some sort of Zoom/Popup effect is used on the RadCalendar : See the attached capture to see what I mean.

I just want to disable this animation, but wasn't able to find it on the defaut template.

Could you help me?

(I know I could use something like

DataTemplateSelector dts = calendar.DayTemplateSelector;
calendar.DayTemplateSelector = null;
calendar.DayTemplateSelector = dts;

instead, wich resolve that issue, but also freeze the control for half a second each time, annoying)

 

Thanks a lot!

3 Answers, 1 is accepted

Sort by
0
Guillaume
Top achievements
Rank 1
answered on 23 Jun 2016, 08:33 AM

Well, I did find some sort of solution, but I had to mess around with your code :

On the namespace Telerik.Windows.Controls.Calendar , the class CalendarAnimation was handling these animations with this method :

internal static void ChangeScaleAndOpacity(FrameworkElement target, double? scaleFrom, double? scaleTo, double? opacityFrom, double? opacityTo, TimeSpan duration, Action<FrameworkElement> action)

So I went to the class TransitionPanel and modify all calls to this method with a duration of TimeSpan.Zero instead of 300ms.

Compiled and used the new dll : So far it seems to be working, maybe I could improve by removing the animations entirely but meh.

 

Basically my RadCalendar's days and RadScheduleView's appointements are synchronized, I just call calendar.OnApplyTemplate() each time I modifiy my appointements.

Could post more code if anyone interested.

0
Richard
Top achievements
Rank 1
answered on 20 Mar 2018, 04:31 AM

Hi Guillaume, I would like to know how to decompile and recompile the Telerik.Windows.Controls and Telerik.Windows.Controls.Input. I need to rewrite the ChangeScaleAndOpacity and set the TimeSpan to zero for me to able to remove the animation in the TransitionPanel. I use the JustDecompile App to decompile the said DLL and try to recompile it but there's a lot of errors. Can you please help me to resolve this? Thank you.

0
Martin Ivanov
Telerik team
answered on 22 Mar 2018, 11:47 AM
Hello Richard,

If you have a developer license for the product you can download the source code from your telerik.com account. You can read more about this in the Download Product Files article. However, before doing this I would strongly recommend you to go through the EULA of the UI for WPF product.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Calendar
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Guillaume
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or