{"record":{"id":"075b07d9267d2fca","repo":"MahApps/MahApps.Metro","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/MahApps.Metro/Controls/TransitioningContentControl.cs","lineNumber":227,"sourceCode":"\n            // find new transition\n            var newStoryboard = source.GetStoryboard(newTransition);\n\n            // unable to find the transition.\n            if (newStoryboard is null)\n            {\n                // could be during initialization of xaml that presentationgroups was not yet defined\n                if (VisualStates.TryGetVisualStateGroup(source, PresentationGroup) is null)\n                {\n                    // will delay check\n                    source.CurrentTransition = null;\n                }\n                else\n                {\n                    // revert to old value\n                    source.SetValue(TransitionProperty, oldTransition);\n\n                    throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, \"Temporary removed exception message\", newTransition));\n                }\n            }\n            else\n            {\n                source.CurrentTransition = newStoryboard;\n            }\n        }\n\n        private static void OnRestartTransitionOnContentChangePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            ((TransitioningContentControl)d).OnRestartTransitionOnContentChangeChanged((bool)e.OldValue, (bool)e.NewValue);\n        }\n\n        protected virtual void OnRestartTransitionOnContentChangeChanged(bool oldValue, bool newValue)\n        {\n        }\n\n        public TransitioningContentControl()","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/MahApps/MahApps.Metro/blob/72099e310bac2d12ac98fd7560b69679252519f5/src/MahApps.Metro/Controls/TransitioningContentControl.cs#L209-L245","documentation":"Thrown by the TransitioningContentControl's Transition property changed callback when the requested TransitionType's storyboard cannot be resolved AND the PresentationGroup visual state group already exists (so it's not an early-init delay). The message text 'Temporary removed exception message' is a known placeholder string; the real signal is the ArgumentException fired in OnTransitionPropertyChanged. It indicates the named transition is not defined in the control's VSM groups.","triggerScenarios":"Setting the Transition property to a TransitionType value whose corresponding VisualState/Storyboard is not present in the applied ControlTemplate's VisualStateManager groups, after the template's PresentationGroup is loaded. Typically with a custom template that defines the group but not the specific transition state.","commonSituations":"Custom TransitioningContentControl ControlTemplate includes the 'PresentationStates' VisualStateGroup but omits one of the named transition states (e.g., 'RightTransition'). Setting Transition to that missing state triggers the exception. Also occurs after upgrading MahApps where transition names changed.","solutions":["Ensure the ControlTemplate's VisualStateManager defines a VisualState for the TransitionType you set (the names map to TransitionType enum values like 'RightTransition', 'LeftTransition', etc.).","Use one of the default MahApps transition styles, or copy the complete set of transition VisualStates from the default template.","If the exception fires during initialization, it may be a timing issue—ensure the control is fully loaded before setting Transition."],"exampleFix":"<!-- before: group exists but state missing -->\n<VisualStateGroup x:Name=\"PresentationStates\">\n    <VisualState x:Name=\"DefaultTransition\"/>\n</VisualStateGroup>\n\n<!-- after: include the state you reference -->\n<VisualStateGroup x:Name=\"PresentationStates\">\n    <VisualState x:Name=\"DefaultTransition\"/>\n    <VisualState x:Name=\"RightTransition\"/>\n    <VisualState x:Name=\"LeftTransition\"/>\n</VisualStateGroup>","handlingStrategy":"validation","validationCode":"// Before setting Transition, verify the VisualState exists in the template\nvar group = VisualStates.TryGetVisualStateGroup(tcc, \"PresentationStates\");\nif (group != null && group.States.Cast<VisualState>().All(s => s.Name != desiredTransition))\n    throw new InvalidOperationException($\"Transition '{desiredTransition}' not defined in template\");\ntcc.Transition = desiredTransition;","typeGuard":null,"tryCatchPattern":"try\n{\n    tcc.Transition = desiredTransition;\n}\ncatch (ArgumentException)\n{\n    // transition not in template; fall back to default\n    tcc.Transition = \"DefaultTransition\";\n}","preventionTips":["When re-templating TransitioningContentControl, copy the full set of transition VisualStates from the default MahApps template.","Only set Transition to a value backed by a VisualState in your template.","After a MahApps upgrade, verify TransitionType names still match your custom template."],"tags":["wpf","mahapps","transitioning-content-control","visual-state","template","animation"],"backgroundTag":null,"analyzedSha":"72099e310bac2d12ac98fd7560b69679252519f5","analyzedAt":"2026-08-13T20:19:34.419Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}