I have a small problem with the visibility of an ellipse.
In runtime I create an Shapes.Ellipse object and connect it to a grid with grid1.Children.Add(ellip).
To control the position of the ellipse I use:
ellip.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
ellip.VerticalAlignment = System.Windows.VerticalAlignment.Top;
ellip.Margin = new Thickness(a,b,0,0);
ellip.Height = 100;
ellip.Width = 100;
In runtime I now keep changing the position within the grid (by changing a and b) but as the alignment is left and top it will be visible outside the grid on those two edges. If the ellipse is too far on the right or bottom it will not be visible outside of it however. Is there any way to have the shape only be visible inside the grid whaver the position it has?
Yep, to use
Canvaspanel instead, which is exactly for drawings.