Example #1
0
        public void Close(bool success, PopupParameters parameters)
        {
            var popup = this.Popups.Pop();

            popup.TaskSource.SetResult(new PopupResult(success, parameters));
            OnPopupsUpdated?.Invoke();
        }
Example #2
0
        public Task <PopupResult> Show(Type componentType, PopupParameters parameters)
        {
            // Build the popup
            var popup = new Popup(componentType);

            foreach (var parameter in parameters)
            {
                popup.Parameters.Add(parameter.Key, parameter.Value);
            }

            // Add popup to the container
            this.Popups.Push(popup);

            // Prevents the container
            OnPopupsUpdated?.Invoke();

            // Wait for the popup to be closed
            return(popup.Task);
        }