示例#1
0
        public Task SetParametersAsync(ParameterView parameters)
        {
            parameters.SetParameterProperties(this);

            if (RouteData == null)
            {
                throw new InvalidOperationException($"The {nameof(RouteView)} component requires a non-null value for the parameter {nameof(RouteData)}.");
            }

            _renderHandle.Render(_renderDelegate);
            return(Task.CompletedTask);
        }
        /// <summary>
        /// Sets parameters supplied by the component's parent in the render tree.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <returns>A <see cref="Task"/> that completes when the component has finished updating and rendering itself.</returns>
        /// <remarks>
        /// <para>
        /// The <see cref="SetParametersAsync(ParameterView)"/> method should be passed the entire set of parameter values each
        /// time <see cref="SetParametersAsync(ParameterView)"/> is called. It not required that the caller supply a parameter
        /// value for all parameters that are logically understood by the component.
        /// </para>
        /// <para>
        /// The default implementation of <see cref="SetParametersAsync(ParameterView)"/> will set the value of each property
        /// decorated with <see cref="ParameterAttribute" /> or <see cref="CascadingParameterAttribute" /> that has
        /// a corresponding value in the <see cref="ParameterView" />. Parameters that do not have a corresponding value
        /// will be unchanged.
        /// </para>
        /// </remarks>
        public virtual Task SetParametersAsync(ParameterView parameters)
        {
            parameters.SetParameterProperties(this);
            if (!_initialized)
            {
                _initialized = true;

                return(RunInitAndSetParametersAsync());
            }
            else
            {
                return(CallOnParametersSetAsync());
            }
        }
示例#3
0
 /// <inheritdoc />
 public Task SetParametersAsync(ParameterView parameters)
 {
     parameters.SetParameterProperties(this);
     Render();
     return(Task.CompletedTask);
 }
 public Task SetParametersAsync(ParameterView parameters)
 {
     parameters.SetParameterProperties(this);
     _registry.SetContent(Name, ChildContent);
     return(Task.CompletedTask);
 }