{"record":{"id":"415289a2d9a78fd1","repo":"dotnet/maui","slug":"title-property-must-be-set-on-flyout-page","errorCode":null,"errorMessage":"Title property must be set on Flyout page","messagePattern":"Title property must be set on Flyout page","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Controls/src/Core/FlyoutPage/FlyoutPage.cs","lineNumber":118,"sourceCode":"\n\t\t/// <summary>Gets or sets a value that indicates whether the flyout is presented. This is a bindable property.</summary>\n\t\tpublic bool IsPresented\n\t\t{\n\t\t\tget { return (bool)GetValue(IsPresentedProperty); }\n\t\t\tset { SetValue(IsPresentedProperty, BooleanBoxes.Box(value)); }\n\t\t}\n\n\t\t/// <summary>Gets or sets the flyout page that is used to present a menu or navigation options.</summary>\n\t\tpublic Page Flyout\n\t\t{\n\t\t\tget { return _flyout; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_flyout != null && value == null)\n\t\t\t\t\tthrow new ArgumentNullException(nameof(value), \"Flyout cannot be set to null once a value is set\");\n\n\t\t\t\tif (string.IsNullOrEmpty(value.Title))\n\t\t\t\t\tthrow new InvalidOperationException(\"Title property must be set on Flyout page\");\n\n\t\t\t\tif (_flyout == value)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (value.RealParent != null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Flyout must not already have a parent.\");\n\n\t\t\t\t// TODO MAUI refine this to fire earlier\n\t\t\t\tvar previousFlyout = _flyout;\n\t\t\t\t\n\t\t\t\t// TODO MAUI refine this to fire earlier\n\t\t\t\tpreviousFlyout?.SendNavigatingFrom(new NavigatingFromEventArgs(value, NavigationType.Replace));\n\n\t\t\t\tOnPropertyChanging();\n\t\t\t\tif (_flyout != null)\n\t\t\t\t\tInternalChildren.Remove(_flyout);\n\t\t\t\t_flyout = value;\n\t\t\t\tInternalChildren.Add(_flyout);","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Controls/src/Core/FlyoutPage/FlyoutPage.cs#L100-L136","documentation":"FlyoutPage.Flyout setter throws InvalidOperationException when the supplied Page has an empty Title. Platform flyout surfaces (drawer header, split master pane, menu items) require a title to render and for accessibility; the guard at FlyoutPage.cs:118 enforces this before any other check.","triggerScenarios":"Assigning a Page whose Title is null or empty string to FlyoutPage.Flyout. Note the check fires even if the new value equals the current Flyout, so re-assigning the same untitled page still throws.","commonSituations":"Building the flyout page programmatically and forgetting to set Title, binding Title to a model property that is initially null, or reusing a ContentPage default-constructed.","solutions":["Set `page.Title = \"Menu\";` before assigning to Flyout.","Ensure the bound Title source is non-empty at assignment time (initialize the model property).","Use a FallbackValue in the Title binding to guarantee a non-empty string."],"exampleFix":"// before\nflyoutPage.Flyout = new ContentPage(); // Title empty\n\n// after\nflyoutPage.Flyout = new ContentPage { Title = \"Menu\" };","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(page.Title)) page.Title = \"Menu\"; flyoutPage.Flyout = page;","typeGuard":"static bool HasTitle(Page p) => !string.IsNullOrEmpty(p.Title);","tryCatchPattern":"try { flyoutPage.Flyout = page; } catch (InvalidOperationException) { page.Title = \"Menu\"; flyoutPage.Flyout = page; }","preventionTips":["Always set Flyout page Title before assignment.","Initialize the bound Title source to a non-empty value.","Use FallbackValue in Title bindings."],"tags":["maui","flyoutpage","navigation","validation"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}