implementing-wpf-rtl-support

Solid

Implements Right-to-Left (RTL) layout support in WPF using FlowDirection. Use when building applications for Arabic, Hebrew, Persian, or other RTL languages.

Web & Frontend 40 stars 6 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
54
Recency 20%
100
Frontmatter 20%
40
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# WPF RTL (Right-to-Left) Support Implement bidirectional text and mirrored layouts for RTL languages. ## 1. RTL Languages | Language | Culture Code | Direction | |----------|-------------|-----------| | Arabic | ar-SA, ar-EG | RTL | | Hebrew | he-IL | RTL | | Persian (Farsi) | fa-IR | RTL | | Urdu | ur-PK | RTL | --- ## 2. Setting FlowDirection ### 2.1 Window Level ```xml <!-- Left-to-Right (default) --> <Window FlowDirection="LeftToRight" Title="My Application"> <!-- Right-to-Left --> <Window FlowDirection="RightToLeft" Title="التطبيق"> ``` ### 2.2 Element Level ```xml <Window FlowDirection="RightToLeft"> <StackPanel> <!-- Inherits RTL from parent --> <TextBlock Text="مرحبا بالعالم"/> <!-- Override to LTR for specific content --> <TextBlock FlowDirection="LeftToRight" Text="user@example.com"/> </StackPanel> </Window> ``` ### 2.3 Resource-Based ```xml <Window FlowDirection="{DynamicResource AppFlowDirection}"> <!-- In ResourceDictionary --> <FlowDirection x:Key="AppFlowDirection">RightToLeft</FlowDirection> ``` --- ## 3. Dynamic FlowDirection ### 3.1 Based on Culture ```csharp public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); SetFlowDirection(); } private void SetFlowDirection() { var culture = Thread.CurrentThread.CurrentUICulture; FlowDirection = culture.TextInfo.IsRightToLeft ? F...

Details

Author
christian289
Repository
christian289/dotnet-with-claudecode
Created
7 months ago
Last Updated
6 days ago
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category