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; } }
private void CloseModal(ModalViewModel obj) { this.popup.IsOpen = false; }