{"record":{"id":"ec2545474e95e5e5","repo":"dotnet/maui","slug":"temporary-removed-exception-message","errorCode":null,"errorMessage":"Temporary removed exception message","messagePattern":"Temporary removed exception message","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Compatibility/Core/src/WPF/Controls/FormsTransitioningContentControl.cs","lineNumber":177,"sourceCode":"\n\t\t\t// find new transition\n\t\t\tStoryboard newStoryboard = source.GetStoryboard(newTransition);\n\n\t\t\t// unable to find the transition.\n\t\t\tif (newStoryboard == null)\n\t\t\t{\n\t\t\t\t// could be during initialization of xaml that presentationgroups was not yet defined\n\t\t\t\tif (VisualStates.TryGetVisualStateGroup(source, PresentationGroup) == null)\n\t\t\t\t{\n\t\t\t\t\t// will delay check\n\t\t\t\t\tsource.CurrentTransition = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// revert to old value\n\t\t\t\t\tsource.SetValue(TransitionProperty, oldTransition);\n\n\t\t\t\t\tthrow new ArgumentException(string.Format(CultureInfo.CurrentCulture, \"Temporary removed exception message\", newTransition));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsource.CurrentTransition = newStoryboard;\n\t\t\t}\n\t\t}\n\n\t\tprivate static void OnRestartTransitionOnContentChangePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n\t\t{\n\t\t\t((FormsTransitioningContentControl)d).OnRestartTransitionOnContentChangeChanged((bool)e.OldValue, (bool)e.NewValue);\n\t\t}\n\n\t\tprotected virtual void OnRestartTransitionOnContentChangeChanged(bool oldValue, bool newValue)\n\t\t{\n\t\t}\n\n\t\tpublic FormsTransitioningContentControl()","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Compatibility/Core/src/WPF/Controls/FormsTransitioningContentControl.cs#L159-L195","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure every value assigned to Transition corresponds to a defined VisualState inside the PresentationGroup.","Before switching transitions at runtime, verify the storyboard exists via VisualStateManager.TryGetVisualStateGroup.","If the throw is unexpected during template initialization, defer setting Transition until after the template is applied.","Treat the opaque message as a control-level bug; file an issue or replace the literal in a fork with a descriptive message."],"exampleFix":"// before\ncontrol.Transition = \"MyTransition\"; // throws placeholder if absent\n\n// after\nif (VisualStateManager.TryGetVisualStateGroup(control, \"PresentationStates\")?.States.Any(s => s.Name == \"MyTransition\") == true)\n{\n    control.Transition = \"MyTransition\";\n}","handlingStrategy":"validation","validationCode":"if (VisualStateManager.TryGetVisualStateGroup(control, PresentationGroup)?.States.Any(s => s.Name == newTransition) == true)\n    control.Transition = newTransition;","typeGuard":"static bool IsKnownTransition(FrameworkElement src, string name) =>\n    VisualStateManager.GetVisualStateGroups(src).OfType<VisualStateGroup>()\n        .SelectMany(g => g.States).Any(s => s.Name == name);","tryCatchPattern":"try { control.Transition = newTransition; }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Temporary removed\"))\n{ /* transition invalid while group present; log and keep old */ }","preventionTips":["Treat the placeholder message as a defect; consider replacing the literal in a fork.","Validate VisualState names exist before assigning Transition.","Delay Transition assignment until OnApplyTemplate completes."],"tags":["wpf","transitions","visual-state","argument","placeholder-message"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}