Hallo,
ich brauche eigentlich nur eine mehrzeilige TextBox mit WholeWordWrapping. Da das mit der normalen TextBox nicht geht, muss ich die RichEditBox benutzen.
Leider kommt man mit der RichEditBox ohne Verrenkungen nicht an den Text ran, da sie (warum auch immer) kein Text Property hat. Deshlab wollte ich mir eins dazubauen.
Bis jetzt sieht das so aus:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| class RichTextBox : RichEditBox { public string Text { get { string text; Document.GetText(Windows.UI.Text.TextGetOptions.None, out text); return text; } set { Document.SetText(Windows.UI.Text.TextSetOptions.None, value); } } } |
Über den Code Behind lässt sich das zuweisen wie bei einer normalen TextBox wenn ich die im XAML Code definiere.
Nun wollte ich das aber über ein Binding machen, das funktioniert damit aber nicht, wenn ich "Text" an einen string binde.
Wie kann ich das "Text" Property bindable machen?
LG Schafschaf