File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ namespace Files.App.Data.Contracts
1111 /// </summary>
1212 public interface IRealTimeLayoutService
1313 {
14+ /// <summary>
15+ /// Occurs when the flow direction of the layout changes.
16+ /// </summary>
17+ public event EventHandler < FlowDirection > ? FlowDirectionChanged ;
18+
1419 /// <summary>
1520 /// Gets the current flow direction for layout (e.g., LeftToRight or RightToLeft).
1621 /// </summary>
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ internal sealed class RealTimeLayoutService : IRealTimeLayoutService
2121 /// </summary>
2222 private readonly List < ( WeakReference < object > Reference , Action Callback ) > _callbacks = [ ] ;
2323
24+ /// <inheritdoc/>
25+ public event EventHandler < FlowDirection > ? FlowDirectionChanged ;
26+
2427 /// <inheritdoc/>
2528 public FlowDirection FlowDirection => CultureInfo . CurrentUICulture . TextInfo . IsRightToLeft ? FlowDirection . RightToLeft : FlowDirection . LeftToRight ;
2629
@@ -122,6 +125,8 @@ private void InvokeCallbacks()
122125 item . Reference . TryGetTarget ( out var targetObject ) && targetObject != null )
123126 . Select ( item => item . Callback ) . ForEach ( callback => callback ( ) ) ;
124127 _callbacks . RemoveAll ( item => ! item . Reference . TryGetTarget ( out _ ) ) ;
128+
129+ FlowDirectionChanged ? . Invoke ( this , FlowDirection ) ;
125130 }
126131 }
127132}
You can’t perform that action at this time.
0 commit comments