I have "made my own" TextBox with some Adorners.
The first Adorner will display the "Title" in it if .Text value is empty.
The second will highlight the border red if the input is wrong..
Works well, but now i have the case that MyTextBox is within a Grid which will be invisible from start up .. instead of a "create new dialog" i make this grid visible as an "popup" within the mainwindow .. works well too!
but if i collapse this Grid, the adorner will stay there ..
how can the TextBox see that it's parent panel is not visible anymore??
Maybe you iterate through the VisualTree using the VisualTreeHelper.getParent()-Method.
If you found your Grid, listen to it´s IsVisibleChanged-Event.
Greetigns