CollectionView template not support RTL

Dani_S 2,746 Reputation points
2023-05-29T12:48:07.0333333+00:00

Hi,

CollectionView template not support RTL.

I attached the file:עברית.txt

Please see the code:

The results is: txt.עיברית

<CollectionView ItemsSource="{Binding Data}">
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <Label Text="{Binding Name}" HorizontalOptions="Start" VerticalTextAlignment="Center" TextColor="Black" FontSize="13" FontAttributes="None" Margin="5,0,0,0"/>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,922 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dani_S 2,746 Reputation points
    2023-06-07T14:33:25.4+00:00

    Here function that check if it RTL:

     // Method to check if a string contains RTL characters
            static bool ContainsRTLCharacters(string text)
            {
                const int RTLCharacterStart = 0x0590;
                const int RTLCharacterEnd = 0x08FF;
    
                var regex = new Regex(@"[\u0590-\u08FF\u200F\u202A-\u202E\u2066-\u2069]");
                return regex.IsMatch(text);
            }
    
    0 comments No comments