I have a simple Grid object, that has one Child, which is a TextBlock object with some text in it. This Grid is inserted into a Canvas. At the beginning WPF calculates the width and height of the grid so that the TextBlock fits into it properly. The problem is that the user is and should be allowed to resize the Grid, which works very fine. But decreasing the Grid leads to a larger TextBlock than the Grid, so that the text is not completely visible any more. I wanted to ask if C# provides me with some function like Grid.hasOverlow() where i can check if the content is larger than the parent.
This is how i am basically adding the Textblock into the grid.
Grid grid = new Grid();
TextBlock tb = new TextBlock();
tb.Text = "Some Text";
grid.Children.Add(tb);
MyCanvas.Children.Add(grid);