I have a TextBlock which contains a button, and I expect that the button will follow the content text of TextBlock.
(The button should be attached to the end of the text of TextBlock.)
My working demo code:
Where "gdRoot" is an arbitrary Grid in XAML.
This code works fine until I change the content of the TextBlock.
Once I change the text of TextBlock, the button disappears.
In real case, the content of TextBlock is bound to a resource, which will change according to the language user selects.
And after "property change" event is triggered, or the text is re-assigned, the button disappears.
As I know, the button is added to the TextBlock's "Inlines" property, and the InlineCollection is intact after "property change" event.
Does anyone know how to avoid button from disappearing?
Thanks in advance.