Upgrading to 11.x - AddOwnerWithDataValidation and ItemContainerGenerator<T> #18138
-
Hello, I am trying to migrate the AvaloniaTokenizingTextBox project to Avalonia 11.x, but I don't know how to refactor some parts of the code. public static readonly DirectProperty<TokenizingTextBox, string> TextProperty =
TextBlock.TextProperty.AddOwnerWithDataValidation<TokenizingTextBox>(
o => o.Text,
(o, v) => o.Text = v,
defaultBindingMode: BindingMode.TwoWay,
enableDataValidation: true);
protected override IItemContainerGenerator CreateItemContainerGenerator()
{
return new ItemContainerGenerator<TokenizingTextBoxItem>(
this,
TokenizingTextBoxItem.ContentProperty,
TokenizingTextBoxItem.ContentTemplateProperty);
} There is no |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You may want to look into TextBlock source and ListBoxSource for reference. |
Beta Was this translation helpful? Give feedback.
-
Answering here.
|
Beta Was this translation helpful? Give feedback.
Answering here.
AddOwnerWithDataValidation
Now is:
You can customize
coerce
callback if you want.CreateItemContainerGenerator
Doesn't exist anymore. Replace the former method with the overrides below: