Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1805 lines (1673 sloc) 99.8 KB
<Type Name="UIApplication+Notifications" FullName="UIKit.UIApplication+Notifications">
<TypeSignature Language="C#" Value="public static class UIApplication.Notifications" />
<TypeSignature Language="ILAsm" Value=".class nested public auto ansi abstract sealed beforefieldinit UIApplication/Notifications extends System.Object" />
<TypeSignature Language="DocId" Value="T:UIKit.UIApplication.Notifications" />
<TypeSignature Language="F#" Value="type UIApplication.Notifications = class" />
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Notification posted by the <see cref="T:UIKit.UIApplication" /> class.</summary>
<remarks>
<para>This is a static class which contains various helper methods that allow developers to observe events posted in the iOS notification hub (<see cref="T:Foundation.NSNotificationCenter" />).</para>
<para>The methods defined in this class post events invoke the provided method or lambda with a <see cref="T:Foundation.NSNotificationEventArgs" /> parameter which contains strongly typed properties for the notification arguments.</para>
</remarks>
</Docs>
<Members>
<Member MemberName="ObserveBackgroundRefreshStatusDidChange">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveBackgroundRefreshStatusDidChange (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveBackgroundRefreshStatusDidChange(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveBackgroundRefreshStatusDidChange : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.BackgroundRefreshStatusDidChangeNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveBackgroundRefreshStatusDidChange">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveBackgroundRefreshStatusDidChange (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveBackgroundRefreshStatusDidChange(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveBackgroundRefreshStatusDidChange : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.BackgroundRefreshStatusDidChangeNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.BackgroundRefreshStatusDidChangeNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange ((notification) => {
Console.WriteLine ("Observed BackgroundRefreshStatusDidChangeNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveBackgroundRefreshStatusDidChange (objectToObserve, (notification) => {
Console.WriteLine ($"Observed BackgroundRefreshStatusDidChangeNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveContentSizeCategoryChanged">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveContentSizeCategoryChanged (EventHandler&lt;UIKit.UIContentSizeCategoryChangedEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveContentSizeCategoryChanged(class System.EventHandler`1&lt;class UIKit.UIContentSizeCategoryChangedEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveContentSizeCategoryChanged(System.EventHandler{UIKit.UIContentSizeCategoryChangedEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveContentSizeCategoryChanged : EventHandler&lt;UIKit.UIContentSizeCategoryChangedEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveContentSizeCategoryChanged handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIContentSizeCategoryChangedEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.ContentSizeCategoryChangedNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how developers can use this method in their code:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveContentSizeCategoryChanged ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("WeakNewValue", args.WeakNewValue);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, UIKit.UIContentSizeCategoryChangedEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("WeakNewValue", args.WeakNewValue);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveContentSizeCategoryChanged (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveContentSizeCategoryChanged">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveContentSizeCategoryChanged (Foundation.NSObject objectToObserve, EventHandler&lt;UIKit.UIContentSizeCategoryChangedEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveContentSizeCategoryChanged(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class UIKit.UIContentSizeCategoryChangedEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveContentSizeCategoryChanged(Foundation.NSObject,System.EventHandler{UIKit.UIContentSizeCategoryChangedEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveContentSizeCategoryChanged : Foundation.NSObject * EventHandler&lt;UIKit.UIContentSizeCategoryChangedEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveContentSizeCategoryChanged (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIContentSizeCategoryChangedEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.ContentSizeCategoryChangedNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.ContentSizeCategoryChangedNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveContentSizeCategoryChanged ((notification) => {
Console.WriteLine ("Observed ContentSizeCategoryChangedNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveContentSizeCategoryChanged (objectToObserve, (notification) => {
Console.WriteLine ($"Observed ContentSizeCategoryChangedNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidBecomeActive">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidBecomeActive (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidBecomeActive(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidBecomeActive(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidBecomeActive : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidBecomeActive handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidBecomeActiveNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveDidBecomeActive ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveDidBecomeActive (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidBecomeActive">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidBecomeActive (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidBecomeActive(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidBecomeActive(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidBecomeActive : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidBecomeActive (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidBecomeActiveNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.DidBecomeActiveNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidBecomeActive ((notification) => {
Console.WriteLine ("Observed DidBecomeActiveNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidBecomeActive (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidBecomeActiveNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidChangeStatusBarFrame">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidChangeStatusBarFrame (EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidChangeStatusBarFrame(class System.EventHandler`1&lt;class UIKit.UIStatusBarFrameChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarFrame(System.EventHandler{UIKit.UIStatusBarFrameChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidChangeStatusBarFrame : EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarFrame handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidChangeStatusBarFrameNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how developers can use this method in their code:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveDidChangeStatusBarFrame ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarFrame", args.StatusBarFrame);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, UIKit.UIStatusBarFrameChangeEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarFrame", args.StatusBarFrame);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveDidChangeStatusBarFrame (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidChangeStatusBarFrame">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidChangeStatusBarFrame (Foundation.NSObject objectToObserve, EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidChangeStatusBarFrame(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class UIKit.UIStatusBarFrameChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarFrame(Foundation.NSObject,System.EventHandler{UIKit.UIStatusBarFrameChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidChangeStatusBarFrame : Foundation.NSObject * EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarFrame (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidChangeStatusBarFrameNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.DidChangeStatusBarFrameNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidChangeStatusBarFrame ((notification) => {
Console.WriteLine ("Observed DidChangeStatusBarFrameNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidChangeStatusBarFrame (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidChangeStatusBarFrameNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidChangeStatusBarOrientation">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidChangeStatusBarOrientation (EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidChangeStatusBarOrientation(class System.EventHandler`1&lt;class UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarOrientation(System.EventHandler{UIKit.UIStatusBarOrientationChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidChangeStatusBarOrientation : EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarOrientation handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidChangeStatusBarOrientationNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how developers can use this method in their code:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveDidChangeStatusBarOrientation ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarOrientation", args.StatusBarOrientation);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, UIKit.UIStatusBarOrientationChangeEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarOrientation", args.StatusBarOrientation);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveDidChangeStatusBarOrientation (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidChangeStatusBarOrientation">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidChangeStatusBarOrientation (Foundation.NSObject objectToObserve, EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidChangeStatusBarOrientation(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarOrientation(Foundation.NSObject,System.EventHandler{UIKit.UIStatusBarOrientationChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidChangeStatusBarOrientation : Foundation.NSObject * EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidChangeStatusBarOrientation (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidChangeStatusBarOrientationNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.DidChangeStatusBarOrientationNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidChangeStatusBarOrientation ((notification) => {
Console.WriteLine ("Observed DidChangeStatusBarOrientationNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidChangeStatusBarOrientation (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidChangeStatusBarOrientationNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidEnterBackground">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidEnterBackground (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidEnterBackground(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidEnterBackground(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidEnterBackground : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidEnterBackground handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidEnterBackgroundNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveDidEnterBackground ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveDidEnterBackground (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidEnterBackground">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidEnterBackground (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidEnterBackground(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidEnterBackground(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidEnterBackground : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidEnterBackground (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidEnterBackgroundNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.DidEnterBackgroundNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidEnterBackground ((notification) => {
Console.WriteLine ("Observed DidEnterBackgroundNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidEnterBackground (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidEnterBackgroundNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidFinishLaunching">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidFinishLaunching (EventHandler&lt;UIKit.UIApplicationLaunchEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidFinishLaunching(class System.EventHandler`1&lt;class UIKit.UIApplicationLaunchEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidFinishLaunching(System.EventHandler{UIKit.UIApplicationLaunchEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidFinishLaunching : EventHandler&lt;UIKit.UIApplicationLaunchEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidFinishLaunching handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIApplicationLaunchEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidFinishLaunchingNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how developers can use this method in their code:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveDidFinishLaunching ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("Url", args.Url);
Console.WriteLine ("SourceApplication", args.SourceApplication);
Console.WriteLine ("RemoteNotifications", args.RemoteNotifications);
Console.WriteLine ("LocationLaunch", args.LocationLaunch);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, UIKit.UIApplicationLaunchEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("Url", args.Url);
Console.WriteLine ("SourceApplication", args.SourceApplication);
Console.WriteLine ("RemoteNotifications", args.RemoteNotifications);
Console.WriteLine ("LocationLaunch", args.LocationLaunch);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveDidFinishLaunching (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidFinishLaunching">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidFinishLaunching (Foundation.NSObject objectToObserve, EventHandler&lt;UIKit.UIApplicationLaunchEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidFinishLaunching(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class UIKit.UIApplicationLaunchEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidFinishLaunching(Foundation.NSObject,System.EventHandler{UIKit.UIApplicationLaunchEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidFinishLaunching : Foundation.NSObject * EventHandler&lt;UIKit.UIApplicationLaunchEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidFinishLaunching (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIApplicationLaunchEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidFinishLaunchingNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.DidFinishLaunchingNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidFinishLaunching ((notification) => {
Console.WriteLine ("Observed DidFinishLaunchingNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidFinishLaunching (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidFinishLaunchingNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidReceiveMemoryWarning">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidReceiveMemoryWarning (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidReceiveMemoryWarning(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidReceiveMemoryWarning(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidReceiveMemoryWarning : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidReceiveMemoryWarning handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidReceiveMemoryWarningNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveDidReceiveMemoryWarning ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveDidReceiveMemoryWarning (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidReceiveMemoryWarning">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidReceiveMemoryWarning (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidReceiveMemoryWarning(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveDidReceiveMemoryWarning(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidReceiveMemoryWarning : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveDidReceiveMemoryWarning (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.DidReceiveMemoryWarningNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.DidReceiveMemoryWarningNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidReceiveMemoryWarning ((notification) => {
Console.WriteLine ("Observed DidReceiveMemoryWarningNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidReceiveMemoryWarning (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidReceiveMemoryWarningNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveProtectedDataDidBecomeAvailable">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveProtectedDataDidBecomeAvailable (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveProtectedDataDidBecomeAvailable(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveProtectedDataDidBecomeAvailable : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=UIKit%20UIApplication%20Protected%20Data%20Did%20Become%20Available%20Notification&amp;scope=Xamarin" title="P:UIKit.UIApplication.ProtectedDataDidBecomeAvailableNotification">P:UIKit.UIApplication.ProtectedDataDidBecomeAvailableNotification</a></format> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveProtectedDataDidBecomeAvailable">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveProtectedDataDidBecomeAvailable (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveProtectedDataDidBecomeAvailable(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveProtectedDataDidBecomeAvailable : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=UIKit%20UIApplication%20Protected%20Data%20Did%20Become%20Available%20Notification&amp;scope=Xamarin" title="P:UIKit.UIApplication.ProtectedDataDidBecomeAvailableNotification">P:UIKit.UIApplication.ProtectedDataDidBecomeAvailableNotification</a></format> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=UIKit%20UIApplication%20Protected%20Data%20Did%20Become%20Available%20Notification&amp;scope=Xamarin" title="P:UIKit.UIApplication.ProtectedDataDidBecomeAvailableNotification">P:UIKit.UIApplication.ProtectedDataDidBecomeAvailableNotification</a></format> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable ((notification) => {
Console.WriteLine ("Observed ProtectedDataDidBecomeAvailableNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveProtectedDataDidBecomeAvailable (objectToObserve, (notification) => {
Console.WriteLine ($"Observed ProtectedDataDidBecomeAvailableNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveProtectedDataWillBecomeUnavailable">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveProtectedDataWillBecomeUnavailable (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveProtectedDataWillBecomeUnavailable(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveProtectedDataWillBecomeUnavailable : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=UIKit%20UIApplication%20Protected%20Data%20Will%20Become%20Unavailable%20Notification&amp;scope=Xamarin" title="P:UIKit.UIApplication.ProtectedDataWillBecomeUnavailableNotification">P:UIKit.UIApplication.ProtectedDataWillBecomeUnavailableNotification</a></format> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveProtectedDataWillBecomeUnavailable">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveProtectedDataWillBecomeUnavailable (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveProtectedDataWillBecomeUnavailable(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveProtectedDataWillBecomeUnavailable : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=UIKit%20UIApplication%20Protected%20Data%20Will%20Become%20Unavailable%20Notification&amp;scope=Xamarin" title="P:UIKit.UIApplication.ProtectedDataWillBecomeUnavailableNotification">P:UIKit.UIApplication.ProtectedDataWillBecomeUnavailableNotification</a></format> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=UIKit%20UIApplication%20Protected%20Data%20Will%20Become%20Unavailable%20Notification&amp;scope=Xamarin" title="P:UIKit.UIApplication.ProtectedDataWillBecomeUnavailableNotification">P:UIKit.UIApplication.ProtectedDataWillBecomeUnavailableNotification</a></format> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable ((notification) => {
Console.WriteLine ("Observed ProtectedDataWillBecomeUnavailableNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveProtectedDataWillBecomeUnavailable (objectToObserve, (notification) => {
Console.WriteLine ($"Observed ProtectedDataWillBecomeUnavailableNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveSignificantTimeChange">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveSignificantTimeChange (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveSignificantTimeChange(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveSignificantTimeChange(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveSignificantTimeChange : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveSignificantTimeChange handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.SignificantTimeChangeNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveSignificantTimeChange ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveSignificantTimeChange (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveSignificantTimeChange">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveSignificantTimeChange (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveSignificantTimeChange(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveSignificantTimeChange(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveSignificantTimeChange : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveSignificantTimeChange (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.SignificantTimeChangeNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.SignificantTimeChangeNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveSignificantTimeChange ((notification) => {
Console.WriteLine ("Observed SignificantTimeChangeNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveSignificantTimeChange (objectToObserve, (notification) => {
Console.WriteLine ($"Observed SignificantTimeChangeNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveUserDidTakeScreenshot">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveUserDidTakeScreenshot (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveUserDidTakeScreenshot(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveUserDidTakeScreenshot(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveUserDidTakeScreenshot : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveUserDidTakeScreenshot handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.UserDidTakeScreenshotNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveUserDidTakeScreenshot ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveUserDidTakeScreenshot (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveUserDidTakeScreenshot">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveUserDidTakeScreenshot (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveUserDidTakeScreenshot(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveUserDidTakeScreenshot(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveUserDidTakeScreenshot : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveUserDidTakeScreenshot (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.UserDidTakeScreenshotNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.UserDidTakeScreenshotNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveUserDidTakeScreenshot ((notification) => {
Console.WriteLine ("Observed UserDidTakeScreenshotNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveUserDidTakeScreenshot (objectToObserve, (notification) => {
Console.WriteLine ($"Observed UserDidTakeScreenshotNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillChangeStatusBarFrame">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillChangeStatusBarFrame (EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillChangeStatusBarFrame(class System.EventHandler`1&lt;class UIKit.UIStatusBarFrameChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarFrame(System.EventHandler{UIKit.UIStatusBarFrameChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillChangeStatusBarFrame : EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarFrame handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillChangeStatusBarFrameNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how developers can use this method in their code:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveWillChangeStatusBarFrame ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarFrame", args.StatusBarFrame);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, UIKit.UIStatusBarFrameChangeEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarFrame", args.StatusBarFrame);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveWillChangeStatusBarFrame (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillChangeStatusBarFrame">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillChangeStatusBarFrame (Foundation.NSObject objectToObserve, EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillChangeStatusBarFrame(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class UIKit.UIStatusBarFrameChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarFrame(Foundation.NSObject,System.EventHandler{UIKit.UIStatusBarFrameChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillChangeStatusBarFrame : Foundation.NSObject * EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarFrame (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarFrameChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillChangeStatusBarFrameNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.WillChangeStatusBarFrameNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveWillChangeStatusBarFrame ((notification) => {
Console.WriteLine ("Observed WillChangeStatusBarFrameNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveWillChangeStatusBarFrame (objectToObserve, (notification) => {
Console.WriteLine ($"Observed WillChangeStatusBarFrameNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillChangeStatusBarOrientation">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillChangeStatusBarOrientation (EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillChangeStatusBarOrientation(class System.EventHandler`1&lt;class UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarOrientation(System.EventHandler{UIKit.UIStatusBarOrientationChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillChangeStatusBarOrientation : EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarOrientation handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillChangeStatusBarOrientationNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how developers can use this method in their code:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveWillChangeStatusBarOrientation ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarOrientation", args.StatusBarOrientation);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, UIKit.UIStatusBarOrientationChangeEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("StatusBarOrientation", args.StatusBarOrientation);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveWillChangeStatusBarOrientation (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillChangeStatusBarOrientation">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillChangeStatusBarOrientation (Foundation.NSObject objectToObserve, EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillChangeStatusBarOrientation(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class UIKit.UIStatusBarOrientationChangeEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarOrientation(Foundation.NSObject,System.EventHandler{UIKit.UIStatusBarOrientationChangeEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillChangeStatusBarOrientation : Foundation.NSObject * EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillChangeStatusBarOrientation (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;UIKit.UIStatusBarOrientationChangeEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillChangeStatusBarOrientationNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.WillChangeStatusBarOrientationNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveWillChangeStatusBarOrientation ((notification) => {
Console.WriteLine ("Observed WillChangeStatusBarOrientationNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveWillChangeStatusBarOrientation (objectToObserve, (notification) => {
Console.WriteLine ($"Observed WillChangeStatusBarOrientationNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillEnterForeground">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillEnterForeground (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillEnterForeground(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillEnterForeground(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillEnterForeground : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillEnterForeground handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillEnterForegroundNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveWillEnterForeground ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveWillEnterForeground (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillEnterForeground">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillEnterForeground (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillEnterForeground(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillEnterForeground(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillEnterForeground : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillEnterForeground (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillEnterForegroundNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.WillEnterForegroundNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveWillEnterForeground ((notification) => {
Console.WriteLine ("Observed WillEnterForegroundNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveWillEnterForeground (objectToObserve, (notification) => {
Console.WriteLine ($"Observed WillEnterForegroundNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillResignActive">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillResignActive (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillResignActive(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillResignActive(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillResignActive : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillResignActive handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillResignActiveNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveWillResignActive ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveWillResignActive (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillResignActive">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillResignActive (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillResignActive(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillResignActive(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillResignActive : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillResignActive (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillResignActiveNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.WillResignActiveNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveWillResignActive ((notification) => {
Console.WriteLine ("Observed WillResignActiveNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveWillResignActive (objectToObserve, (notification) => {
Console.WriteLine ($"Observed WillResignActiveNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillTerminate">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillTerminate (EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillTerminate(class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillTerminate(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillTerminate : EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillTerminate handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillTerminateNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = UIApplication.Notifications.ObserveWillTerminate ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = UIApplication.Notifications.ObserveWillTerminate (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveWillTerminate">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveWillTerminate (Foundation.NSObject objectToObserve, EventHandler&lt;Foundation.NSNotificationEventArgs&gt; handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveWillTerminate(class Foundation.NSObject objectToObserve, class System.EventHandler`1&lt;class Foundation.NSNotificationEventArgs&gt; handler) cil managed" />
<MemberSignature Language="DocId" Value="M:UIKit.UIApplication.Notifications.ObserveWillTerminate(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveWillTerminate : Foundation.NSObject * EventHandler&lt;Foundation.NSNotificationEventArgs&gt; -&gt; Foundation.NSObject" Usage="UIKit.UIApplication.Notifications.ObserveWillTerminate (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler&lt;Foundation.NSNotificationEventArgs&gt;" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:UIKit.UIApplication.WillTerminateNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:UIKit.UIApplication.WillTerminateNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveWillTerminate ((notification) => {
Console.WriteLine ("Observed WillTerminateNotification!");
};
// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveWillTerminate (objectToObserve, (notification) => {
Console.WriteLine ($"Observed WillTerminateNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.