Monday, June 11, 2007

Changing Silverlight Text Direction Right to Left

In some languages text has to be displayed in right to left direction. 
For this case we don't have any property supported by XAML, Java script.
To achieve it we can use following traditional way.
Silverlight 1.1
        char[] str = mystr.Text.ToCharArray();
Array.Reverse(str);
mystr.Text = new string(str);

Silverlight 1.0


mystr.Text = mystr.Text.split('').reverse.join('');
Hope It could be useful for silverlight lovers. Please post your comments bellow.

4 comments:

Yosi said...

you could have given the credit to tamir who post it on: http://blogs.microsoft.co.il/blogs/tamir/archive/2007/06/10/Right_2D00_To_2D00_Left-support-for-Silverlight.aspx

Kevin said...

Rhe problem is that rtl languages display numbers the same way as ltr languages (28 is still "28", not "82") and often times english must be displayed inline.

Barbie Chiu said...

I understand that every person has the passion in any aspects or things. If you love something and it came in front of you it completes your day and your mood turns into something you won't expected. I love your work and I want to read more about it. Visit my site if you have time . Thank you.

triciajoy.com

www.triciajoy.com

Silvia Jacinto said...

Today you suffer pain and neglect but tomorrow is an another day so worry no more because every pain has an exchange. The exchange to it is happiness and unconditional love. Visit my site for more information. Have a good day and God bless your site.

n8fan.net

www.n8fan.net