Bug 16469 - Missing binding for UIWindowLevel
Summary: Missing binding for UIWindowLevel
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.0.4.x
Hardware: Macintosh Windows
: Low enhancement
Target Milestone: 7.0.6
Assignee: Bugzilla
Depends on:
Reported: 2013-11-26 19:27 UTC by Tom Gilder
Modified: 2013-12-18 03:53 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Tom Gilder 2013-11-26 19:27:07 UTC
UIWindow's WindowLevel property is bound to a float, but should be bound to a corresponding enum (UIWindowLevel.Normal, UIWindowLevel.Alert and UIWindowLevel.StatusBar).


Comment 1 Sebastien Pouliot 2013-11-27 08:19:26 UTC
This is not a mistake. The native/ObjC definition is a `float`, e.g.

    typedef CGFloat UIWindowLevel;

(from your 2nd link) and C# does not allow `enums` to be based on on floats (or doubles).

It's uncommon and it generally means any (float) value is valid and some specific values are given as constants (e.g. you can insert yourwelf between the defined values).

OTOH we should expose enum values as constants (so I'm not closing the bug).
Comment 2 Sebastien Pouliot 2013-11-28 09:29:15 UTC
The next (non-hotfix) release will include a new type that expose the 3 constants.

public static class UIWindowLevel {
	// properties
	public static float Alert { get; }
	public static float Normal { get; }
	public static float StatusBar { get; }

So it will be possible to do:

    window.WindowLevel = UIWindowLevel.Alert;

while still allowing any other float values.

Fixed in master d85bf4987d98b9b3101aed798113fb9c2719f8e7
QA: unit tests added in the same revision.
Comment 3 PJ 2013-12-11 18:45:45 UTC
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
Comment 4 Sadik Ali 2013-12-18 03:53:43 UTC
I verified this issue, following are the verified steps:

1. Created a sample iOS project.
2. opened monotouch assembly and searched "WindowLevel"
3. verified that UIWindowLevel class added with all above mentioned properties.

Refer screen shot: http://screencast.com/t/H0K6y6TdJ

Checked with:
All Mac
XS 4.2.3 (build 20)
X. iOS