Example #1
0
        public static UIModel <TModel> RegisterViewModel <TModel>(this UiActor actor, string name, IViewModel <TModel>?model = null)
            where TModel : class
        {
            model ??= actor.LifetimeScope.Resolve <IViewModel <TModel> >();

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

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