No Window.FlowDirection support for desktop applications
WinUI XAML does not support FlowDirection or equivalent attribute on the Window element. Additionally, the Window class does not contain a FlowDirection property for programmatic access.
This impacts developers migrating from WPF XAML or WinRT XAML and overall global readiness.
Potential workaround:
// ...
var native_window = managed_window.As<IWindowNative>();
var extended_style = GetWindowLong(native_window.WindowHandle, GWL_EXSTYLE);
SetWindowLong(native_window.WindowHandle, GWL_EXSTYLE, extended_style | WS_EX_LAYOUTRTL);
managed_window.Activate();
// ...
Steps to reproduce the bug
- File > New > WinUI 3 blank desktop packaged application
- Attempt to add
FlowDirection=FlowDirection.RightToLeftattribute to root Window element inMainWindow.xaml - Observe error
Expected behavior Easy way to enable RTL support via XAML and programmatically.
Version Info NuGet package version: Microsoft.WinUI 3.0.0-preview4.210210.4
Windows app type:
| UWP | Win32 |
|---|---|
| Yes |
| Windows 10 version | Saw the problem? |
|---|---|
| Insider Build (21313) | Yes |
| October 2020 Update (19042) | |
| May 2020 Update (19041) | |
| November 2019 Update (18363) | |
| May 2019 Update (18362) | |
| October 2018 Update (17763) | |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) |
| Device form factor | Saw the problem? |
|---|---|
| Desktop | Yes |
| Xbox | |
| Surface Hub | |
| IoT |
@codendone FYI
@Austin-Lamb FYI
Marking this as a feature proposal and throwing it into the freezer is very disappointing.
This is missing i18n functionality, something Microsoft would once consider a blocker to shipping. Everyone that wants to support RTL will now have to have to manually plumb in the necessary interfaces and P/Invoke signatures (C#/Win32 does not support WinUI) to support something supported in WinForms over a decade ago. WinUI Preview 3 didn't even properly support WS_EX_LAYOUTRTL, so I can only imagine what bugs lie in wait.
@riverar, you are right this is basic funtionality that should be there, but it requires a new APIs, and new APIs is a feature request.
Hi, is there any workaround for this that can be used from C#?
@marb2000 FYI
any news on this item?
Any news?