There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Setting a transition's duration
I can't find an obvious way of setting the duration of a transition. I have a TransitionalElement on a window and I wish to initialise it with a single Transition which is used everytime the 'Content' changes.
In my Window's constructor, I initialise the TransitionalElement as follows:
transitionElement.Content = new PageOne();
FadeAndBlurTransition transition = new FadeAndBlurTransition();
transition.Duration = new Duration(new TimeSpan(0, 0, 1));
transitionElement.Transition = transition;
The above code throws an exception. Could this be because I am initialising this in the wrong place?
An ideal interface would see an initialising constructor added to FadeAndBlurTransition (and other transitions too) where you could pass in the desired duration, i.e:
FadeAndBlurTransition transition = new FadeAndBlurTransition( new Duration( new TimeSpan( 0, 0, 1 ) ) );
I also don't like the fact that I have to create a new TimeSpan object within the constructor of a new Duration object when you set the duration of a transition. Ideally the initialising constructor would accept the duration in seconds, and would do the appropriate