Arabic and Hebrew languages bidirectional support for Silverlight 2.0 beta 2

17 ביולי 2008

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/arabic-and-hebrew-languages-bidirectional-support-for-silverlight-20-beta-2/]


Those days, I’m, together with guys from Microsoft Egypt and Santeon, finishing development of bidirectional input and output support for Silverlight. I want you to take part in alpha testing of this solution. Please see the test form here and try it.

Also, you can download latest development build or compiled binary version with debug symbols and try it yourself. Please, if you’re in any issue, report it, by using issue tracker in CodePlex.

In order to use it, all you have to do is to use custom namespace within your project and then, you’ll be able to get almost all controls, you know, but with Arabic and Hebrew RTL and LTR support. You have to set one property: FlowDirection to change the rendering method (exactly as in WPF). Here an example of usage.

<UserControl x:Class="BidiTest2.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:l="clr-namespace:System.Windows.BidiControls;assembly=BidiControls">

<l:TextBlock FlowDirection="LeftToRight" Text="שלום עולם"/>

<l:TextBox FlowDirection="RightToLeft" Text="{Binding Text, Mode=TwoWay}"/>

That’s all. Thank you for your cooperation.

image

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *

31 תגובות

  1. slyi17 ביולי 2008 ב 14:10

    This is great news. Congraduations.
    One question have you applied this to scrollviewer aswell eg: http://www.windojitsu.com/blog/leftiescrollviewer.html

    הגב
  2. Tamir Khason17 ביולי 2008 ב 14:14

    Yes, we defentely change alignment of scrollers and other controls. But not in alpha stage.

    הגב
  3. tzahi17 ביולי 2008 ב 14:25

    Hi,

    Great work, thanks.

    One thing – something is wrong with the text when there's more then one line (the whole text gets mixed).

    Tzahi

    הגב
  4. Tamir Khason17 ביולי 2008 ב 14:41

    Tzahi, Please provide the example of the text you enter. textwrap should work correctly.

    הגב
  5. tzahi17 ביולי 2008 ב 15:57

    If I insert, for example "היום הלכתי לים וראיתי מדוזה מאוד גדולה ונבהלתי ורצתי חזרה הביתה מהר", then the text in the bottom window is ok, but the textbox itself is mixed.
    I see the usge when there's no interaction by the user (like backspacing and so on), but if I want to provide it to the user to insert text then I don't see how it fits.

    or am I missing something?

    Thanks,

    Tzahi.

    הגב
  6. Tamir Khason17 ביולי 2008 ב 16:02

    Ah, ok
    TextBox has AllowReturn property, that actually tells TextBox to wrap text correctly. In demo version this property set to false. You can download latest binary release and test it with AllowReturn set to true

    הגב
  7. tzahi17 ביולי 2008 ב 17:00

    Tried it – doesn't work.

    הגב
  8. fred17 ביולי 2008 ב 17:00

    Great !!

    Is it already possible to define a resource file like resources.he.resx ?
    I didn't find the he folder ?

    Thanks
    Fred

    הגב
  9. Tamir Khason17 ביולי 2008 ב 17:06

    Tzahi. Ok, I saw and filled http://www.codeplex.com/SilverlightRTL/WorkItem/View.aspx?WorkItemId=5595 We'll take care on it

    Fred, no it's impossible. This is the only way it can work by now…

    הגב
  10. tzahi17 ביולי 2008 ב 20:29

    Hi again,

    Q: How do I change the background color of the textbox, for instance?

    Thanks,

    Tzahi

    הגב
  11. Tamir Khason17 ביולי 2008 ב 20:42

    Hi, Tzahi
    and thank you again.
    Yes, this is defently my bug. I forgot to add Background and Foreground properties to control template 🙂

    הגב
  12. tzahi17 ביולי 2008 ב 22:12

    I added Background="{TemplateBinding Background}" in the TextBox section in generic.xaml . It didn't work out.
    Am I missing something?

    הגב
  13. Tamir Khason18 ביולי 2008 ב 8:48

    Hi, Tzahi
    I'm investigating it

    הגב
  14. fred27 ביולי 2008 ב 8:48

    Hi

    is the FontSize is working, I try several combinations without success for example

    Any idea ?

    Thanks

    Fred

    הגב
  15. Tamir Khason27 ביולי 2008 ב 11:44

    Hi, Fred
    It still does not work. We are working on this issue

    הגב
  16. Hosseingt@yahoo.com31 ביולי 2008 ב 2:44

    hi
    i tested "سلام" but it answered "سلما"
    thanks.

    הגב
  17. fred1 באוגוסט 2008 ב 4:40

    Hi

    is it possible to center a text in a textBox ?
    if yes how ?
    is it possible to change the FontFamily in a textBox as
    for example textBox.FontFamily = new FontFamily("Narkisim"); ?
    if yes which one is working in hebrew ?

    thanks
    Fred

    הגב
  18. Tzahi2 באוגוסט 2008 ב 16:29

    Hi,

    Do you reckon that you'll fix the hebrew text mix issue anytime soon? and the background issues?

    I'm just trying to figure out whether I could use it in my project…..

    Thanks,

    Tzahi

    הגב
  19. Tamir Khason3 באוגוסט 2008 ב 6:44

    Tzahi, Background is core issue with Silverlight and has no connection to RTL controls. This will be fixed in RTM (you can use it as is, when RTM will be out, this start work)

    Fred, Yes, this supported in RTL controls

    Hosseingt, I get it absolutely right. You should use it within right side controls in this page

    הגב
  20. Tzahi6 באוגוסט 2008 ב 3:05

    Hi Tamir,

    My due date for my project is 21/8 and I wonder whether to wait for your fixes or find another workaround for the hebrew textbox (what bothers me most is the mixed multiline issue) what do you think\recommend?

    Thanks,

    Tzahi.

    הגב
  21. Esther3 בספטמבר 2008 ב 9:37

    Hey Tamir,

    Sounds like this will be a great solution for my project in Hebrew.
    But I can't figure out how to include this namespace into my project?
    That is – which files do belong to the namespace and where I should put them and how reference to them.

    Could you please help me with that?
    Thanks in advance.

    הגב
  22. youssouph5 בספטמבר 2008 ב 7:07

    please,i need some things on Bidirectional Visitors Counter
    it is my project topic.kindly reply as soon as possible

    הגב
  23. Hai Berchick12 בספטמבר 2008 ב 2:41

    Ver 2 Beta 2 is out and work can be done….
    XAML's on the way…

    R E S P E C T for the bidirectional support efforts
    Take your time.

    We here can use images for now… XAML handles them goood 😉

    הגב
  24. fred2 באוקטובר 2008 ב 16:00

    Hi
    I have some problems with the new version of SL2 RC0.
    What I have to do in order to continue using your Bidi controls ?
    Thanks
    Fred

    הגב
  25. Tamir Khason3 באוקטובר 2008 ב 15:45

    hi, Fred
    Those days we are working on upgrading toward Rc0. Stay tuned

    הגב
  26. E16 באוקטובר 2008 ב 14:17

    Now that 2.0 is released, are you adjusting the code (+demo) to fit?

    הגב
  27. Yossi1 בנובמבר 2008 ב 7:04

    2.0 is released ………. We Need To Start Use SilverLight And We Need Hebrew !!!

    Many Many Many Tahnks

    הגב
  28. Abdulmalik9 בנובמבר 2008 ב 5:27

    Hello,

    many thanks for this beautiful library

    but there is an issue for Arabic language

    when you write

    ال

    it reflect the two second characters

    like this

    الرحمن

    it types

    ارلحمن

    in that way it is impossible to use it in Arabic,

    hope there is any solution very soon

    Thank you,

    הגב
  29. Elad15 בנובמבר 2008 ב 2:17

    Hi Tamir,

    Great work there…
    Now that Silverlight 2 is RTMed – are you planning to update the code to the final release?
    I am using the files with RTM version, and I receive an exception: Unable to cast system.windows.bidicontrols.textbox to system.windows.controls.textbox.

    Can you help?

    Thank,
    Elad

    הגב
  30. tz18 בנובמבר 2008 ב 16:40

    Blend crashes every time I load a project referencing the Bidi dll. does anyone here has a clue?

    Thanks,

    t.

    הגב