question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No Window.FlowDirection support for desktop applications

See original GitHub issue

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

  1. File > New > WinUI 3 blank desktop packaged application
  2. Attempt to add FlowDirection=FlowDirection.RightToLeft attribute to root Window element in MainWindow.xaml
  3. 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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marb2000commented, Feb 20, 2021

@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.

0reactions
ahasscommented, Dec 20, 2022

any news on this item?

Read more comments on GitHub >

github_iconTop Results From Across the Web

FlowDirection Enum (Windows.UI.Xaml) - UWP
Indicates that content should flow from right to left. Remarks. The FlowDirection enumeration is used as a value by the FrameworkElement.FlowDirection property.
Read more >
FlowDirection Enum (System.Windows)
Defines constants that specify the content flow direction for text and user interface (UI) elements.
Read more >
Setting FlowDirection to RightToLeft for all windows in an ...
Try to set static FlowDirection property to your app static property Windows::UI::Xaml::FlowDirection FlowDirection{ ...
Read more >
Flow Direction (Spatial Analyst)—ArcMap | Documentation
This tool supports parallel processing. If your computer has multiple processors or processors with multiple cores, better performance may be achieved, ...
Read more >
Flow Direction (Spatial Analyst)—ArcGIS Pro | Documentation
This tool supports parallel processing. If your computer has multiple processors or processors with multiple cores, better performance may be achieved, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found