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.

5 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

Avigdor Liberman said...

There are actually quite a lot of particulars like that to take into consideration. That is a nice point to carry up. I supply the thoughts above as general inspiration but clearly there are questions like the one you deliver up the place an important factor might be working in sincere good faith. I don?t know if best practices have emerged round things like that, however I'm positive that your job is clearly identified as a fair game. Each boys and girls feel the impression of only a second’s pleasure, for the rest of their lives. mgm online casino