public void Close()
        {
            if (_action == null)
            {
                throw new InvalidOperationException();
            }


            ClosePopup();


            _action.Close();
            _action = null;
        }
        public IAsyncOperation <string> ShowAsync()
        {
            if (_action != null)
            {
                throw new InvalidOperationException();
            }


            var window = Window.Current;


            Canvas.SetLeft(Popup, 0);
            Canvas.SetTop(Popup, 0);
            Grid.Width   = Popup.Width = window.Bounds.Width;
            Grid.Height  = Popup.Height = window.Bounds.Height;
            Popup.IsOpen = true;


            return(_action = new ContentPopupShowAsyncOperation());
        }
        private void ConfirmNoCloseClick(object sender, RoutedEventArgs e)
        {
            var button = (Button)sender;

            if (button != null)
            {
                bool isValid = CheckIsValid();

                if (isValid)
                {
                    _action.SetResult((string)button.Tag);


                    _action.Close();
                    _action = null;
                    //Close();
                }
                else
                {
                    InvalidWarning.Visibility = Windows.UI.Xaml.Visibility.Visible;
                }
            }
        }