Well, you could go through VisualTreeand delete everything that has a type Border.
static public void RemoveVisual(Visual myVisual)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(myVisual); i++)
{
Visual childVisual = (Visual)VisualTreeHelper.GetChild(myVisual, i);
if(childVisual.GetType() == typeof(Border))
{
}
RemoveVisual(childVisual);
}
}
The delete that I leave to you, but the above should find all the controls in a visual type view Border.
source
share