Question

I am trying to convert an open source flyout menu from Objective-C to Xamarin. The current issue I have is that the Obj-C code creates a frame using CGRectInfinite. This does not appear to be available under MonoTouch, via the usual RectangleF class. Is there an alternative?

Similarly, there does not appear to be a CGRectIsInfinite equivalent in RectangleF. What, if any, is the alternative?

Was it helpful?

Solution

Add this using statement first:

using MonoTouch.CoreGraphics;

Then you can test it with this:

public static RectangleF GetInfinite()
{
    var image = CIImage.EmptyImage;

    if (image.Extent.IsInfinite ())
    {
        return image.Extent;
    }

    throw new Exception ("Unable to create infinite rect");
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top