maui-linux/Xamarin.Forms.Core/WeakReferenceExtensions.cs

16 строки
318 B
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
using System;
namespace Xamarin.Forms
{
static class WeakReferenceExtensions
2016-03-22 23:02:25 +03:00
{
internal static bool TryGetTarget<T>(this WeakReference self, out T target) where T : class
{
if (self == null)
throw new ArgumentNullException(nameof(self));
2016-03-22 23:02:25 +03:00
target = (T)self.Target;
return target != null;
}
}
}