dotnet/maui · error · ArgumentException

Temporary removed exception message

Error message

Temporary removed exception message

What it means

FormsTransitioningContentControl.OnTransitionChanged throws ArgumentException with the placeholder text "Temporary removed exception message" when a new Transition is assigned while the PresentationGroup visual-state group already exists, but the new transition storyboard cannot be applied. The code reverts the property to the old value, then throws. The message is a known leftover placeholder from development and conveys no diagnostic detail.

Source

Thrown at src/Compatibility/Core/src/WPF/Controls/FormsTransitioningContentControl.cs:177

			// find new transition
			Storyboard newStoryboard = source.GetStoryboard(newTransition);

			// unable to find the transition.
			if (newStoryboard == null)
			{
				// could be during initialization of xaml that presentationgroups was not yet defined
				if (VisualStates.TryGetVisualStateGroup(source, PresentationGroup) == null)
				{
					// will delay check
					source.CurrentTransition = null;
				}
				else
				{
					// revert to old value
					source.SetValue(TransitionProperty, oldTransition);

					throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Temporary removed exception message", newTransition));
				}
			}
			else
			{
				source.CurrentTransition = newStoryboard;
			}
		}

		private static void OnRestartTransitionOnContentChangePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			((FormsTransitioningContentControl)d).OnRestartTransitionOnContentChangeChanged((bool)e.OldValue, (bool)e.NewValue);
		}

		protected virtual void OnRestartTransitionOnContentChangeChanged(bool oldValue, bool newValue)
		{
		}

		public FormsTransitioningContentControl()

View on GitHub (pinned to f377ff1c5e)

Solutions

  1. Ensure every value assigned to Transition corresponds to a defined VisualState inside the PresentationGroup.
  2. Before switching transitions at runtime, verify the storyboard exists via VisualStateManager.TryGetVisualStateGroup.
  3. If the throw is unexpected during template initialization, defer setting Transition until after the template is applied.
  4. Treat the opaque message as a control-level bug; file an issue or replace the literal in a fork with a descriptive message.

Example fix

// before
control.Transition = "MyTransition"; // throws placeholder if absent

// after
if (VisualStateManager.TryGetVisualStateGroup(control, "PresentationStates")?.States.Any(s => s.Name == "MyTransition") == true)
{
    control.Transition = "MyTransition";
}
Defensive patterns

Strategy: validation

Validate before calling

if (VisualStateManager.TryGetVisualStateGroup(control, PresentationGroup)?.States.Any(s => s.Name == newTransition) == true)
    control.Transition = newTransition;

Type guard

static bool IsKnownTransition(FrameworkElement src, string name) =>
    VisualStateManager.GetVisualStateGroups(src).OfType<VisualStateGroup>()
        .SelectMany(g => g.States).Any(s => s.Name == name);

Try / catch

try { control.Transition = newTransition; }
catch (ArgumentException ex) when (ex.Message.Contains("Temporary removed"))
{ /* transition invalid while group present; log and keep old */ }

Prevention

When it happens

Trigger: Assigning the Transition DependencyProperty to a value that resolves to no valid storyboard while VisualStates.TryGetVisualStateGroup(source, PresentationGroup) is non-null; XAML binding Transition to an undefined state name after the control has initialized its presentation group.

Common situations: Renaming or removing a VisualState but keeping the Transition name in XAML; switching themes/templates at runtime with stale transition names; using this control in a custom template without the expected presentation states.

Related errors


AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13). Data as JSON: /api/errors/ec2545474e95e5e5. Report an issue: GitHub.