summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs75
-rw-r--r--Xamarin.Forms.Core/MessagingCenter.cs89
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml205
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml229
4 files changed, 570 insertions, 28 deletions
diff --git a/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs b/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs
index 3cd91ed..2107513 100644
--- a/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs
+++ b/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs
@@ -246,7 +246,7 @@ namespace Xamarin.Forms.Core.UnitTests
GC.Collect();
GC.WaitForPendingFinalizers();
-
+
Assert.IsTrue(wr.IsAlive); // The closure in Subscribe should be keeping the subscriber alive
Assert.IsNotNull(wr.Target as TestSubcriber);
@@ -272,10 +272,10 @@ namespace Xamarin.Forms.Core.UnitTests
MessagingCenter.Subscribe<TestPublisher>(subscriber, "test", p => subscriber.SetSuccess());
})();
- Assert.IsNotNull(wr.Target as TestSubcriber);
+ Assert.IsNotNull(wr.Target as TestSubcriber);
MessagingCenter.Unsubscribe<TestPublisher>(wr.Target, "test");
-
+
GC.Collect();
GC.WaitForPendingFinalizers();
@@ -309,12 +309,12 @@ namespace Xamarin.Forms.Core.UnitTests
var source = new MessagingCenterTestsCallbackSource();
MessagingCenter.Subscribe<TestPublisher>(_subscriber, "test", p => source.SuccessCallback(ref success));
-
+
GC.Collect();
GC.WaitForPendingFinalizers();
var pub = new TestPublisher();
- pub.Test();
+ pub.Test();
Assert.True(success); // TestCallbackSource.SuccessCallback() should be invoked to make success == true
}
@@ -372,5 +372,70 @@ namespace Xamarin.Forms.Core.UnitTests
i = i + 1;
}
}
+
+ [Test(Description = "This is a demonstration of what a test with a fake/mock/substitute IMessagingCenter might look like")]
+ public void TestMessagingCenterSubstitute()
+ {
+ var mc = new FakeMessagingCenter();
+
+ // In the real world, you'd construct this with `new ComponentWithMessagingDependency(MessagingCenter.Instance);`
+ var component = new ComponentWithMessagingDependency(mc);
+ component.DoAThing();
+
+ Assert.IsTrue(mc.WasSubscribeCalled, "ComponentWithMessagingDependency should have subscribed in its constructor");
+ Assert.IsTrue(mc.WasSendCalled, "The DoAThing method should send a message");
+ }
+
+ class ComponentWithMessagingDependency
+ {
+ readonly IMessagingCenter _messagingCenter;
+
+ public ComponentWithMessagingDependency(IMessagingCenter messagingCenter)
+ {
+ _messagingCenter = messagingCenter;
+ _messagingCenter.Subscribe<ComponentWithMessagingDependency>(this, "test", dependency => Console.WriteLine("test"));
+ }
+
+ public void DoAThing()
+ {
+ _messagingCenter.Send(this, "test");
+ }
+ }
+
+ internal class FakeMessagingCenter : IMessagingCenter
+ {
+ public bool WasSubscribeCalled { get; private set; }
+ public bool WasSendCalled { get; private set; }
+
+ public void Send<TSender, TArgs>(TSender sender, string message, TArgs args) where TSender : class
+ {
+ WasSendCalled = true;
+ }
+
+ public void Send<TSender>(TSender sender, string message) where TSender : class
+ {
+ WasSendCalled = true;
+ }
+
+ public void Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source = default(TSender)) where TSender : class
+ {
+ WasSubscribeCalled = true;
+ }
+
+ public void Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source = default(TSender)) where TSender : class
+ {
+ WasSubscribeCalled = true;
+ }
+
+ public void Unsubscribe<TSender, TArgs>(object subscriber, string message) where TSender : class
+ {
+
+ }
+
+ public void Unsubscribe<TSender>(object subscriber, string message) where TSender : class
+ {
+
+ }
+ }
}
}
diff --git a/Xamarin.Forms.Core/MessagingCenter.cs b/Xamarin.Forms.Core/MessagingCenter.cs
index b6a167d..d5753e1 100644
--- a/Xamarin.Forms.Core/MessagingCenter.cs
+++ b/Xamarin.Forms.Core/MessagingCenter.cs
@@ -2,12 +2,28 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
-using System.Runtime.CompilerServices;
namespace Xamarin.Forms
{
- public static class MessagingCenter
+ public interface IMessagingCenter
{
+ void Send<TSender, TArgs>(TSender sender, string message, TArgs args) where TSender : class;
+
+ void Send<TSender>(TSender sender, string message) where TSender : class;
+
+ void Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source = null) where TSender : class;
+
+ void Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source = null) where TSender : class;
+
+ void Unsubscribe<TSender, TArgs>(object subscriber, string message) where TSender : class;
+
+ void Unsubscribe<TSender>(object subscriber, string message) where TSender : class;
+ }
+
+ public class MessagingCenter : IMessagingCenter
+ {
+ public static IMessagingCenter Instance { get; } = new MessagingCenter();
+
class Sender : Tuple<string, Type, Type>
{
public Sender(string message, Type senderType, Type argType) : base(message, senderType, argType)
@@ -19,8 +35,8 @@ namespace Xamarin.Forms
class MaybeWeakReference
{
- WeakReference DelegateWeakReference { get; set; }
- object DelegateStrongReference { get; set; }
+ WeakReference DelegateWeakReference { get; }
+ object DelegateStrongReference { get; }
readonly bool _isStrongReference;
@@ -84,11 +100,16 @@ namespace Xamarin.Forms
}
}
- static readonly Dictionary<Sender, List<Subscription>> s_subscriptions =
+ readonly Dictionary<Sender, List<Subscription>> _subscriptions =
new Dictionary<Sender, List<Subscription>>();
public static void Send<TSender, TArgs>(TSender sender, string message, TArgs args) where TSender : class
{
+ Instance.Send(sender, message, args);
+ }
+
+ void IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args)
+ {
if (sender == null)
throw new ArgumentNullException(nameof(sender));
InnerSend(message, typeof(TSender), typeof(TArgs), sender, args);
@@ -96,6 +117,11 @@ namespace Xamarin.Forms
public static void Send<TSender>(TSender sender, string message) where TSender : class
{
+ Instance.Send(sender, message);
+ }
+
+ void IMessagingCenter.Send<TSender>(TSender sender, string message)
+ {
if (sender == null)
throw new ArgumentNullException(nameof(sender));
InnerSend(message, typeof(TSender), null, sender, null);
@@ -103,6 +129,11 @@ namespace Xamarin.Forms
public static void Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source = null) where TSender : class
{
+ Instance.Subscribe(subscriber, message, callback, source);
+ }
+
+ void IMessagingCenter.Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source)
+ {
if (subscriber == null)
throw new ArgumentNullException(nameof(subscriber));
if (callback == null)
@@ -121,6 +152,11 @@ namespace Xamarin.Forms
public static void Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source = null) where TSender : class
{
+ Instance.Subscribe(subscriber, message, callback, source);
+ }
+
+ void IMessagingCenter.Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source)
+ {
if (subscriber == null)
throw new ArgumentNullException(nameof(subscriber));
if (callback == null)
@@ -139,27 +175,32 @@ namespace Xamarin.Forms
public static void Unsubscribe<TSender, TArgs>(object subscriber, string message) where TSender : class
{
+ Instance.Unsubscribe<TSender, TArgs>(subscriber, message);
+ }
+
+ void IMessagingCenter.Unsubscribe<TSender, TArgs>(object subscriber, string message)
+ {
InnerUnsubscribe(message, typeof(TSender), typeof(TArgs), subscriber);
}
public static void Unsubscribe<TSender>(object subscriber, string message) where TSender : class
{
- InnerUnsubscribe(message, typeof(TSender), null, subscriber);
+ Instance.Unsubscribe<TSender>(subscriber, message);
}
- internal static void ClearSubscribers()
+ void IMessagingCenter.Unsubscribe<TSender>(object subscriber, string message)
{
- s_subscriptions.Clear();
+ InnerUnsubscribe(message, typeof(TSender), null, subscriber);
}
- static void InnerSend(string message, Type senderType, Type argType, object sender, object args)
+ void InnerSend(string message, Type senderType, Type argType, object sender, object args)
{
if (message == null)
throw new ArgumentNullException(nameof(message));
var key = new Sender(message, senderType, argType);
- if (!s_subscriptions.ContainsKey(key))
+ if (!_subscriptions.ContainsKey(key))
return;
- List<Subscription> subcriptions = s_subscriptions[key];
+ List<Subscription> subcriptions = _subscriptions[key];
if (subcriptions == null || !subcriptions.Any())
return; // should not be reachable
@@ -178,24 +219,24 @@ namespace Xamarin.Forms
}
}
- static void InnerSubscribe(object subscriber, string message, Type senderType, Type argType, object target, MethodInfo methodInfo, Filter filter)
+ void InnerSubscribe(object subscriber, string message, Type senderType, Type argType, object target, MethodInfo methodInfo, Filter filter)
{
if (message == null)
throw new ArgumentNullException(nameof(message));
var key = new Sender(message, senderType, argType);
var value = new Subscription(subscriber, target, methodInfo, filter);
- if (s_subscriptions.ContainsKey(key))
+ if (_subscriptions.ContainsKey(key))
{
- s_subscriptions[key].Add(value);
+ _subscriptions[key].Add(value);
}
else
{
var list = new List<Subscription> { value };
- s_subscriptions[key] = list;
+ _subscriptions[key] = list;
}
}
- static void InnerUnsubscribe(string message, Type senderType, Type argType, object subscriber)
+ void InnerUnsubscribe(string message, Type senderType, Type argType, object subscriber)
{
if (subscriber == null)
throw new ArgumentNullException(nameof(subscriber));
@@ -203,11 +244,19 @@ namespace Xamarin.Forms
throw new ArgumentNullException(nameof(message));
var key = new Sender(message, senderType, argType);
- if (!s_subscriptions.ContainsKey(key))
+ if (!_subscriptions.ContainsKey(key))
return;
- s_subscriptions[key].RemoveAll(sub => sub.CanBeRemoved() || sub.Subscriber.Target == subscriber);
- if (!s_subscriptions[key].Any())
- s_subscriptions.Remove(key);
+ _subscriptions[key].RemoveAll(sub => sub.CanBeRemoved() || sub.Subscriber.Target == subscriber);
+ if (!_subscriptions[key].Any())
+ _subscriptions.Remove(key);
+ }
+
+ // This is a bit gross; it only exists to support the unit tests in PageTests
+ // because the implementations of ActionSheet, Alert, and IsBusy are all very
+ // tightly coupled to the MessagingCenter singleton
+ internal static void ClearSubscribers()
+ {
+ (Instance as MessagingCenter)?._subscriptions.Clear();
}
}
} \ No newline at end of file
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml
new file mode 100644
index 0000000..1c16a99
--- /dev/null
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml
@@ -0,0 +1,205 @@
+<Type Name="IMessagingCenter" FullName="Xamarin.Forms.IMessagingCenter">
+ <TypeSignature Language="C#" Value="public interface IMessagingCenter" />
+ <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IMessagingCenter" />
+ <AssemblyInfo>
+ <AssemblyName>Xamarin.Forms.Core</AssemblyName>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName="Send&lt;TSender&gt;">
+ <MemberSignature Language="C#" Value="public void Send&lt;TSender&gt; (TSender sender, string message) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Send&lt;class TSender&gt;(!!TSender sender, string message) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="sender" Type="TSender" />
+ <Parameter Name="message" Type="System.String" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <param name="sender">To be added.</param>
+ <param name="message">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Send&lt;TSender,TArgs&gt;">
+ <MemberSignature Language="C#" Value="public void Send&lt;TSender,TArgs&gt; (TSender sender, string message, TArgs args) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Send&lt;class TSender, TArgs&gt;(!!TSender sender, string message, !!TArgs args) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ <TypeParameter Name="TArgs" />
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="sender" Type="TSender" />
+ <Parameter Name="message" Type="System.String" />
+ <Parameter Name="args" Type="TArgs" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <typeparam name="TArgs">To be added.</typeparam>
+ <param name="sender">To be added.</param>
+ <param name="message">To be added.</param>
+ <param name="args">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Subscribe&lt;TSender&gt;">
+ <MemberSignature Language="C#" Value="public void Subscribe&lt;TSender&gt; (object subscriber, string message, Action&lt;TSender&gt; callback, TSender source = null) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Subscribe&lt;class TSender&gt;(object subscriber, string message, class System.Action`1&lt;!!TSender&gt; callback, !!TSender source) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ <Parameter Name="callback" Type="System.Action&lt;TSender&gt;" />
+ <Parameter Name="source" Type="TSender" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <param name="callback">To be added.</param>
+ <param name="source">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Subscribe&lt;TSender,TArgs&gt;">
+ <MemberSignature Language="C#" Value="public void Subscribe&lt;TSender,TArgs&gt; (object subscriber, string message, Action&lt;TSender,TArgs&gt; callback, TSender source = null) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Subscribe&lt;class TSender, TArgs&gt;(object subscriber, string message, class System.Action`2&lt;!!TSender, !!TArgs&gt; callback, !!TSender source) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ <TypeParameter Name="TArgs" />
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ <Parameter Name="callback" Type="System.Action&lt;TSender,TArgs&gt;" />
+ <Parameter Name="source" Type="TSender" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <typeparam name="TArgs">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <param name="callback">To be added.</param>
+ <param name="source">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Unsubscribe&lt;TSender&gt;">
+ <MemberSignature Language="C#" Value="public void Unsubscribe&lt;TSender&gt; (object subscriber, string message) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Unsubscribe&lt;class TSender&gt;(object subscriber, string message) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Unsubscribe&lt;TSender,TArgs&gt;">
+ <MemberSignature Language="C#" Value="public void Unsubscribe&lt;TSender,TArgs&gt; (object subscriber, string message) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Unsubscribe&lt;class TSender, TArgs&gt;(object subscriber, string message) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ <TypeParameter Name="TArgs" />
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <typeparam name="TArgs">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml
index f21f011..f87451e 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml
@@ -1,6 +1,6 @@
<Type Name="MessagingCenter" FullName="Xamarin.Forms.MessagingCenter">
- <TypeSignature Language="C#" Value="public static class MessagingCenter" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit MessagingCenter extends System.Object" />
+ <TypeSignature Language="C#" Value="public class MessagingCenter : Xamarin.Forms.IMessagingCenter" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MessagingCenter extends System.Object implements class Xamarin.Forms.IMessagingCenter" />
<AssemblyInfo>
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
@@ -14,7 +14,11 @@
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
- <Interfaces />
+ <Interfaces>
+ <Interface>
+ <InterfaceName>Xamarin.Forms.IMessagingCenter</InterfaceName>
+ </Interface>
+ </Interfaces>
<Docs>
<summary>Associates a callback on subscribers with a specific message name.</summary>
<remarks>
@@ -40,6 +44,35 @@ Assert.AreEqual(2, subscriber.IntProperty);
</remarks>
</Docs>
<Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public MessagingCenter ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Instance">
+ <MemberSignature Language="C#" Value="public static Xamarin.Forms.IMessagingCenter Instance { get; }" />
+ <MemberSignature Language="ILAsm" Value=".property class Xamarin.Forms.IMessagingCenter Instance" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>Xamarin.Forms.IMessagingCenter</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
<Member MemberName="Send&lt;TSender&gt;">
<MemberSignature Language="C#" Value="public static void Send&lt;TSender&gt; (TSender sender, string message) where TSender : class;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Send&lt;class TSender&gt;(!!TSender sender, string message) cil managed" />
@@ -259,5 +292,195 @@ Assert.AreEqual(2, subscriber.IntProperty);
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="Xamarin.Forms.IMessagingCenter.Send&lt;TSender&gt;">
+ <MemberSignature Language="C#" Value="void IMessagingCenter.Send&lt;TSender&gt; (TSender sender, string message) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Send&lt;class TSender&gt;(!!TSender sender, string message) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="sender" Type="TSender" />
+ <Parameter Name="message" Type="System.String" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <param name="sender">To be added.</param>
+ <param name="message">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Xamarin.Forms.IMessagingCenter.Send&lt;TSender,TArgs&gt;">
+ <MemberSignature Language="C#" Value="void IMessagingCenter.Send&lt;TSender,TArgs&gt; (TSender sender, string message, TArgs args) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Send&lt;class TSender, TArgs&gt;(!!TSender sender, string message, !!TArgs args) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ <TypeParameter Name="TArgs" />
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="sender" Type="TSender" />
+ <Parameter Name="message" Type="System.String" />
+ <Parameter Name="args" Type="TArgs" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <typeparam name="TArgs">To be added.</typeparam>
+ <param name="sender">To be added.</param>
+ <param name="message">To be added.</param>
+ <param name="args">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Xamarin.Forms.IMessagingCenter.Subscribe&lt;TSender&gt;">
+ <MemberSignature Language="C#" Value="void IMessagingCenter.Subscribe&lt;TSender&gt; (object subscriber, string message, Action&lt;TSender&gt; callback, TSender source) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Subscribe&lt;class TSender&gt;(object subscriber, string message, class System.Action`1&lt;!!TSender&gt; callback, !!TSender source) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ <Parameter Name="callback" Type="System.Action&lt;TSender&gt;" />
+ <Parameter Name="source" Type="TSender" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <param name="callback">To be added.</param>
+ <param name="source">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Xamarin.Forms.IMessagingCenter.Subscribe&lt;TSender,TArgs&gt;">
+ <MemberSignature Language="C#" Value="void IMessagingCenter.Subscribe&lt;TSender,TArgs&gt; (object subscriber, string message, Action&lt;TSender,TArgs&gt; callback, TSender source) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Subscribe&lt;class TSender, TArgs&gt;(object subscriber, string message, class System.Action`2&lt;!!TSender, !!TArgs&gt; callback, !!TSender source) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ <TypeParameter Name="TArgs" />
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ <Parameter Name="callback" Type="System.Action&lt;TSender,TArgs&gt;" />
+ <Parameter Name="source" Type="TSender" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <typeparam name="TArgs">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <param name="callback">To be added.</param>
+ <param name="source">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;TSender&gt;">
+ <MemberSignature Language="C#" Value="void IMessagingCenter.Unsubscribe&lt;TSender&gt; (object subscriber, string message) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;class TSender&gt;(object subscriber, string message) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;TSender,TArgs&gt;">
+ <MemberSignature Language="C#" Value="void IMessagingCenter.Unsubscribe&lt;TSender,TArgs&gt; (object subscriber, string message) where TSender : class;" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;class TSender, TArgs&gt;(object subscriber, string message) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <TypeParameters>
+ <TypeParameter Name="TSender">
+ <Constraints>
+ <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
+ </Constraints>
+ </TypeParameter>
+ <TypeParameter Name="TArgs" />
+ </TypeParameters>
+ <Parameters>
+ <Parameter Name="subscriber" Type="System.Object" />
+ <Parameter Name="message" Type="System.String" />
+ </Parameters>
+ <Docs>
+ <typeparam name="TSender">To be added.</typeparam>
+ <typeparam name="TArgs">To be added.</typeparam>
+ <param name="subscriber">To be added.</param>
+ <param name="message">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
</Members>
</Type>