Hi All
I would like to prevent the transition control from showing any transition/animation under certain conditions. For example, the content is bound to an enum field, for certain enum values I dont want it to transition.
I have tried using IValueConverter
public
class
DispatchContentTransitionConverter : IValueConverter
{
public
TransitionProvider TransitionForward {
get
;
set
; }
public
TransitionProvider TransitionBackward {
get
;
set
; }
public
TransitionProvider NoTransition {
get
;
set
; }
public
object
Convert(
object
value, Type targetType,
object
parameter, CultureInfo culture)
{
if
(value ==
null
)
return
NoTransition;
KeyValuePair<
int
,
string
> OSDispatchStatus = (KeyValuePair<
int
,
string
>)value;
if
(OSDispatchStatus.Key == SettingsConsts.OS_DispatchStatus_ReadytoBookCollection)
{
return
TransitionForward;
}
else
{
return
NoTransition;
}
}
public
object
ConvertBack(
object
value, Type targetType,
object
parameter, CultureInfo culture)
{
throw
new
NotImplementedException();
}
}
But for this option I cannot set a "No Transition" transition
Second option tried: Setting Duration of the transition on TransitionStatusChanged, but this option only applies to the "Next" transition called not the current
private
void
MainTransControl_TransitionStatusChanged(
object
sender, Telerik.Windows.Controls.TransitionControl.TransitionStatusChangedEventArgs e)
{
OrderDispatchModel VM = DataContext
as
OrderDispatchModel;
if
(VM !=
null
)
{
if
(VM.OSDispatchStatus.Key == SettingsConsts.OS_DispatchStatus_ReadytoBookCollection)
{
this
.MainTransControl.Duration =
new
TimeSpan(0, 0, 1);
}
else
{
this
.MainTransControl.Duration =
new
TimeSpan(0, 0, 0);
}
}
else
{
this
.MainTransControl.Duration =
new
TimeSpan(0, 0, 0);
}
}
Anyone have any ideas of how to implement this?