desktop-shell-maximized-content-inset

Inset hosted WPF content margins on maximize using WindowResizeBorderThickness.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/BSchafer01/PanelNester --skill desktop-shell-maximized-content-inset
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: desktop-shell-maximized-content-inset
Source: https://github.com/BSchafer01/PanelNester/tree/main/.squad/skills/desktop-shell-maximized-content-inset
Command: npx skills add https://github.com/BSchafer01/PanelNester --skill desktop-shell-maximized-content-inset

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In custom WPF shells that use WindowStyle=None and WindowChrome, hosted content (such as a WebView2 UI) can visually clip at the native boundary when the window is maximized. This approach provides a proven method to inset the hosted content so visuals stay intact across maximize/restore transitions.

Core Features & Use Cases

  • Inset the hosted content container on maximize to prevent clipping at the native boundary.
  • Keep the host chrome and the hosted content visually separated to avoid layout collisions and ensure consistent padding.
  • Compatible with common hosting scenarios (WebView2, hosted UIs) and restoration behavior after unmaximize.

Quick Start

Add an inset to the hosted content container when the window is maximized, using SystemParameters.WindowResizeBorderThickness for the margins, and reset on restore.

Frequently Asked Questions about desktop-shell-maximized-content-inset

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my WPF window clip hosted content when maximized with WindowChrome?

WPF window maximize clipping occurs when custom WindowStyle=None shells extend hosted content past the native boundary. Applying an inset margin using SystemParameters.WindowResizeBorderThickness prevents this visual clipping behavior.

How do I prevent WebView2 visual clipping when maximizing a custom chrome WPF window?

Prevent WebView2 clipping by inset hosting content at the native boundary during maximize. Check WindowState.Maximized, apply WindowResizeBorderThickness margins to the host container, and reset margins on window restore.

What is the best way to handle WPF maximize layout collisions with hosted UI?

The best way to handle maximize layout collisions is inset hosting. Separating the host chrome from hosted content with dynamic margins ensures consistent padding and prevents visual collisions across maximize and restore transitions.

Does this WPF maximize inset pattern work with restore transitions?

Yes, the maximize inset pattern supports restore transitions. It requires implementing host container margin logic that applies insets during WindowState.Maximized and completely resets margins when the window returns to its restored state.

Can I use SystemParameters.WindowResizeBorderThickness to fix WPF maximize clipping?

Yes, SystemParameters.WindowResizeBorderThickness provides the exact native boundary values needed. Applying these thickness values as margins to the hosted content container respects the top chrome and prevents visual clipping.