# XAML Migration Guide Detailed reference for migrating XAML from WPF to WinUI 3, based on the ImageResizer migration. ## XML Namespace Declaration Changes ### Before (WPF) ```xml ``` ### After (WinUI 3) ```xml ``` ### Key Changes | WPF Syntax | WinUI 3 Syntax | Notes | |------------|---------------|-------| | `clr-namespace:Foo` | `using:Foo` | CLR namespace mapping | | `clr-namespace:Foo;assembly=Bar` | `using:Foo` | Assembly qualification not needed | | `xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"` | **Remove entirely** | WPF-UI namespace no longer needed | | `xmlns:p="clr-namespace:...Properties"` | **Remove** | No more `.resx` string bindings | | `sys:String` (from mscorlib) | `x:String` | XAML intrinsic types | | `sys:Int32` | `x:Int32` | XAML intrinsic types | | `sys:Boolean` | `x:Boolean` | XAML intrinsic types | | `sys:Double` | `x:Double` | XAML intrinsic types | ## Unsupported Markup Extensions | WPF Markup Extension | WinUI 3 Alternative | |----------------------|---------------------| | `{DynamicResource Key}` | `{ThemeResource Key}` (theme-reactive) or `{StaticResource Key}` | | `{x:Static Type.Member}` | `{x:Bind}` to a static property, or code-behind | | `{x:Type local:MyType}` | Not supported; use code-behind | | `{x:Array}` | Not supported; create collections in code-behind | | `{x:Code}` | Not supported | ### DynamicResource → ThemeResource ```xml ``` `ThemeResource` automatically updates when the app theme changes (Light/Dark/HighContrast). For truly dynamic non-theme resources, set values in code-behind or use data binding. ### x:Static Resource Strings → x:Uid This is the most pervasive XAML change. WPF used `{x:Static}` to bind to strongly-typed `.resx` resource strings. WinUI 3 uses `x:Uid` with `.resw` files. **WPF:** ```xml