예제 #1
0
        /// <summary>
        /// Method called to show the component.  Returns a task which is set to complete when Dismiss or Close is called internally
        /// </summary>
        /// <typeparam name="TModal"></typeparam>
        /// <param name="options"></param>
        /// <returns></returns>
        public Task <ModalResult> ShowAsync <TModal>(ModalOptions options) where TModal : IComponent
        {
            this.Options = options;
            this._modalcompletiontask = new TaskCompletionSource <ModalResult>();
            var i = 0;

            this._Content = new RenderFragment(builder =>
            {
                builder.OpenComponent(i++, typeof(TModal));
                builder.CloseComponent();
            });
            this._ShowModal = true;
            InvokeAsync(Render);
            return(_modalcompletiontask.Task);
        }
예제 #2
0
 /// <summary>
 /// Method to update the state of the display based on UIOptions
 /// </summary>
 /// <param name="options"></param>
 public void Update(ModalOptions options = null)
 {
     this.Options = options ??= this.Options;
     InvokeAsync(Render);
 }