コード例 #1
0
        private void ShowModal(ModalViewModel viewModel)
        {
            Page    page    = null;
            Element element = this;

            while (page == null && element != null)
            {
                element = element.Parent;
                page    = element as Page;
            }

            if (page != null)
            {
                if (this.popupContent == null)
                {
                    this.popupContent = (View)((ControlTemplate)this.Resources["PopupTemplate"]).CreateContent();
                    this.popupContent.BindingContextChanged += this.PopupContent_BindingContextChanged;
                }

                if (this.popup == null)
                {
                    this.popup         = new RadPopup();
                    this.popup.Content = this.popupContent;
                    this.popup.IsModal = true;
                    this.popup.OutsideBackgroundColor = Color.FromHex("6F000000");
                    this.popup.Placement     = PlacementMode.Center;
                    this.popup.AnimationType = PopupAnimationType.Zoom;
                }

                this.popup.IsOpen = true;
            }
        }
コード例 #2
0
 private void CloseModal(ModalViewModel obj)
 {
     this.popup.IsOpen = false;
 }