문제

Like the title says. I have a grid into which i place several elements via the Grid.SetRow() method:

Grid.SetRow(myElement, 0);

Later on I want to remove these items but I have no idea how.

Just dropping the reference to the ui element doesnt seem to do the trick.

Any ideas?

도움이 되었습니까?

해결책

You can remove it using the Children collection in the grid variable:

// get grid instance
Grid grid = GetGrid();
// Remove element
grid.Children.Remove(myElement);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top