It's really this simple. I want the Width of my entire screen in Xamarin.Forms. You'd think that when I call ParentView.Width
, it will return for me the width of the parent view. Instead, it returns me an exception. "Object reference not an instance of an object."
What do I do to get the Width of a parent view so that I can manipulate a child element based on that width. For instance:
int xPos = this.Width*0.5;
//or
int xPos = ParentView.Width*0.5;