{"record":{"id":"b76bf7d0b936e6ca","repo":"lepoco/wpfui","slug":"cannot-apply-backdrop-effect-if-extendscontentinto","errorCode":null,"errorMessage":"Cannot apply backdrop effect if ExtendsContentIntoTitleBar is false.","messagePattern":"Cannot apply backdrop effect if ExtendsContentIntoTitleBar is false\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Wpf.Ui/Controls/FluentWindow/FluentWindow.cs","lineNumber":244,"sourceCode":"            newValue = WindowBackdropType.None;\n        }\n\n        if (InteropHelper.Handle == IntPtr.Zero)\n        {\n            return;\n        }\n\n        SetWindowChrome();\n\n        if (newValue == WindowBackdropType.None)\n        {\n            _ = WindowBackdrop.RemoveBackdrop(this);\n            return;\n        }\n\n        if (!ExtendsContentIntoTitleBar)\n        {\n            throw new InvalidOperationException(\n                $\"Cannot apply backdrop effect if {nameof(ExtendsContentIntoTitleBar)} is false.\"\n            );\n        }\n\n        if (WindowBackdrop.IsSupported(newValue) && WindowBackdrop.RemoveBackground(this))\n        {\n            _ = WindowBackdrop.ApplyBackdrop(this, newValue);\n\n            _ = WindowBackdrop.RemoveTitlebarBackground(this);\n        }\n    }\n\n    /// <summary>\n    /// Private <see cref=\"ExtendsContentIntoTitleBar\"/> property callback.\n    /// </summary>\n    private static void OnExtendsContentIntoTitleBarChanged(\n        DependencyObject d,\n        DependencyPropertyChangedEventArgs e","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/lepoco/wpfui/blob/ffebacd61058170cf63864b7d5aa730cffff848a/src/Wpf.Ui/Controls/FluentWindow/FluentWindow.cs#L226-L262","documentation":"Thrown by FluentWindow.OnBackdropTypeChanged when the new backdrop type is anything other than None but ExtendsContentIntoTitleBar is false. Window backdrop effects (Mica, Acrylic, etc.) require the window's content to extend into the title bar area so the backdrop shows through; without that, the legacy title bar would occlude the effect. The library treats this as an invalid configuration rather than silently degrading.","triggerScenarios":"Setting WindowBackdropType to Mica/Acrylic/Tabbed (via property or OnBackdropTypeChanged) while ExtendsContentIntoTitleBar is false; binding the backdrop type to a value before enabling the extended title bar; applying a backdrop at construction where ExtendsContentIntoTitleBar defaults to false.","commonSituations":"Enabling Mica on a FluentWindow without setting ExtendsContentIntoTitleBar in XAML; toggling backdrop type from a view-model whose initial state does not also extend content; reading a 'how to enable Mica' guide that omitted the title-bar step.","solutions":["Set ExtendsContentIntoTitleBar = true before or together with the non-None WindowBackdropType.","In XAML, set both attributes on the FluentWindow: ExtendsContentIntoTitleBar=\"True\" and WindowBackdropType=\"Mica\".","If you genuinely want a standard title bar, keep WindowBackdropType = None.","When binding, sequence the view-model so IsExtendedContentIntoTitleBar is set first."],"exampleFix":"<!-- before -->\n<ui:FluentWindow WindowBackdropType=\"Mica\"/> <!-- throws -->\n\n<!-- after -->\n<ui:FluentWindow ExtendsContentIntoTitleBar=\"True\" WindowBackdropType=\"Mica\"/>","handlingStrategy":"validation","validationCode":"if (window.WindowBackdropType != WindowBackdropType.None && !window.ExtendsContentIntoTitleBar)\n    throw new InvalidOperationException(\"Set ExtendsContentIntoTitleBar before backdrop.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair WindowBackdropType with ExtendsContentIntoTitleBar=\"True\" in XAML.","When binding backdrop type from a view-model, set the title-bar property first.","Keep WindowBackdropType = None if you need the standard title bar."],"tags":["wpf","fluentwindow","backdrop","configuration","windows-11"],"backgroundTag":null,"analyzedSha":"ffebacd61058170cf63864b7d5aa730cffff848a","analyzedAt":"2026-08-13T21:36:01.370Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}