public static void ViewNotNull <T>(this IReadonlyProperty <T> me, Lifetime lifetime, Action <Lifetime, T> handler) where T : class { me.View(lifetime, (lf, v) => { if (v != null) { handler(lf, v); } }); }
public static void ViewNull <T>(this IReadonlyProperty <T?> me, Lifetime lifetime, Action <Lifetime> handler) where T : struct { me.View(lifetime, (lf, v) => { if (v == null) { handler(lf); } }); }
public static void WhenFalse([NotNull] this IReadonlyProperty <bool> property, Lifetime lifetime, [NotNull] Action <Lifetime> handler) { if (property == null) { throw new ArgumentNullException(nameof(property)); } if (handler == null) { throw new ArgumentNullException(nameof(handler)); } property.View(lifetime, (lf, value) => { if (!value) { handler(lf); } }); }