예제 #1
0
        internal static IBindableView GetBindableView(BindingGroup group)
        {
            WeakReference <IBindableView> weakReference = null;

            BindableViews.TryGetValue(group.Id, out weakReference);
            return(weakReference?.GetOrDefault());
        }
예제 #2
0
 /// <summary>
 /// Indicates whether this <see cref="WeakReference{T}"/> is alive.
 /// </summary>
 /// <typeparam name="T">The type of the object.</typeparam>
 /// <param name="self">The weak reference.</param>
 /// <returns></returns>
 public static bool IsAlive <T>(this WeakReference <T> self) where T : class
 {
     return(self?.GetOrDefault() != default(T));
 }