public static UIModel <TModel> RegisterViewModel <TModel>(this IUiActor actor, string name, Maybe <IViewModel <TModel> > mayModel = default)
            where TModel : class
        {
            var model = mayModel.OrElse(() => actor.LifetimeScope.Resolve <IViewModel <TModel> >());

            if (!model.IsInitialized)
            {
                model.InitModel(ExposedReceiveActor.ExposedContext, May(name));
            }

            return(new UIModel <TModel>(actor.RegisterProperty <IViewModel <TModel> >(name).WithDefaultValue(model).Property));
        }
Esempio n. 2
0
 internal FluentPropertyRegistration(string name, IUiActor actor)
 {
     Property = new UIProperty <TData>(name);
     actor.RegisterProperty(Property);
 }