MaterialDesignInXAML/MaterialDesignInXamlToolkit · error · XamlParseException
Could not parse to type {typeof(TransitionEffectKind).FullNa
Error message
Could not parse to type {typeof(TransitionEffectKind).FullName} or {typeof(TransitionEffectBase).FullName}. What it means
TransitionEffectTypeConverter converts a XAML attribute into a TransitionEffectBase. It first tries Enum.TryParse on the string against TransitionEffectKind; failing that it attempts to cast the value to TransitionEffectBase. If both fail it throws XamlParseException naming both candidate types, surfacing a clear load-time error rather than a silent wrong transition.
Source
Thrown at src/MaterialDesignThemes.Wpf/Transitions/TransitionEffectTypeConverter.cs:28
return sourceType == typeof(string) || typeof(TransitionEffectKind).IsAssignableFrom(sourceType);
}
public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
{
TransitionEffectBase? transitionEffect;
if (value is string stringValue &&
Enum.TryParse(stringValue, out TransitionEffectKind effectKind))
{
transitionEffect = new TransitionEffect(effectKind);
}
else
{
transitionEffect = value as TransitionEffectBase;
}
if (transitionEffect is null)
throw new XamlParseException($"Could not parse to type {typeof(TransitionEffectKind).FullName} or {typeof(TransitionEffectBase).FullName}.");
return transitionEffect;
}
}
View on GitHub (pinned to 98edec3a0b)
Solutions
- Use a valid TransitionEffectKind name (e.g. 'FadeIn', 'SlideInFromLeft', 'Expand').
- Check the TransitionEffectKind enum in your installed version for the exact available names.
- Assign a TransitionEffect or other TransitionEffectBase instance instead of a string.
Example fix
<!-- before --> <md:TransitioningContent TransitionEffect="FadeInn" /> <!-- after --> <md:TransitioningContent TransitionEffect="FadeIn" />
Defensive patterns
Strategy: validation
Validate before calling
if (!Enum.TryParse<TransitionEffectKind>(stringValue, out _))
throw new ArgumentException($"'{stringValue}' is not a valid TransitionEffectKind.");
// then set the property / use the converter Type guard
Enum.TryParse<TransitionEffectKind>(stringValue, out _)
Prevention
- Cross-check transition names against the TransitionEffectKind enum for your version.
- Assign a TransitionEffectBase instance when the kind is dynamic.
- Validate user-supplied transition strings before binding them to the property.
When it happens
Trigger: Setting a transition-related attribute in XAML to a string that is not a valid TransitionEffectKind name and is not a TransitionEffectBase instance; the exception appears at XAML load/parse time.
Common situations: Typos in transition names (e.g. 'FadeInn'); using an enum name that was renamed/removed after a version upgrade; assigning a non-transition object to the property.
Related errors
- value
- Content cannot be passed to a dialog via the OpenDialog if D
- Unable to find a DialogHost in visual tree
- Unable to find a DialogHost with identifier '{dialogIdentifi
- Unable to find a DialogHost in visual tree ancestry
AI-assisted analysis of MaterialDesignInXAML/MaterialDesignInXamlToolkit@98edec3a0b (2026-08-13).
Data as JSON: /api/errors/6c261ffa53a9b0b6.
Report an issue: GitHub.