diff --git a/samples/ControlCatalog/MainView.xaml.cs b/samples/ControlCatalog/MainView.xaml.cs index 1726028a3f..a9bf150ff9 100644 --- a/samples/ControlCatalog/MainView.xaml.cs +++ b/samples/ControlCatalog/MainView.xaml.cs @@ -60,7 +60,7 @@ namespace ControlCatalog { if (flowDirections.SelectedItem is FlowDirection flowDirection) { - this.FlowDirection = flowDirection; + TopLevel.GetTopLevel(this).FlowDirection = flowDirection; } }; diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index c2e997464c..3bd566c622 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -615,6 +615,13 @@ namespace Avalonia.Controls KeyboardDevice.Instance?.SetFocusedElement(null, NavigationMethod.Unspecified, KeyModifiers.None); } + protected override bool BypassFlowDirectionPolicies => true; + + public override void InvalidateMirrorTransform() + { + // Do nothing becuase TopLevel should't apply MirrorTransform on himself. + } + ITextInputMethodImpl? ITextInputMethodRoot.InputMethod => (PlatformImpl as ITopLevelImplWithTextInputMethod)?.TextInputMethod; }