/// <inheritdoc /> public TPopup ShowPopup <TPopup>(PopupRegion popupRegion, params object[] injections) where TPopup : IPopupView { TPopup popupView = this.container.Resolve <TPopup>(injections); var uiElement = (FrameworkElement)(object)popupView; this.ShowPopup(popupRegion, uiElement); return(popupView); }
private void ShowPopup(PopupRegion region, FrameworkElement content) { switch (region) { case PopupRegion.AppToolBarRight: this.DisposePopupContent(this.AppToolBarRightPopup); this.AppToolBarRightPopup.VerticalOffset = 0; this.AppToolBarRightPopup.Child = content; this.AppToolBarRightPopup.Width = content.Width; this.AppToolBarRightPopup.Height = content.Height; this.AppToolBarRightPopup.IsOpen = true; break; case PopupRegion.AppToolBarLeft: this.DisposePopupContent(this.AppToolBarLeftPopup); this.AppToolBarLeftPopup.VerticalOffset = 0; this.AppToolBarLeftPopup.Child = content; this.AppToolBarLeftPopup.Width = content.Width; this.AppToolBarLeftPopup.Height = content.Height; this.AppToolBarLeftPopup.IsOpen = true; break; case PopupRegion.Full: if (this.fullScreenPopup != null) { this.DisposePopupContent(this.fullScreenPopup); this.fullScreenPopup.Closed -= this.FullScreenPopupViewClosed; this.fullScreenPopup = null; ((Storyboard)this.Resources["ActivateFullScreenPopup"]).Stop(); } this.fullScreenPopup = new Popup() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, IsLightDismissEnabled = false }; this.fullScreenPopup.Closed += FullScreenPopupViewClosed; this.fullScreenPopup.Child = content; this.UpdateFullScreenPopupSize(); this.fullScreenPopup.IsOpen = true; this.fullScreenPopup.Opacity = 1.0; this.UpdateBottomAppBarVisibility(); this.UpdateTopAppBarVisibility(); Storyboard.SetTarget(((Storyboard)this.Resources["ActivateFullScreenPopup"]), this.fullScreenPopup); ((Storyboard)this.Resources["ActivateFullScreenPopup"]).Begin(); break; default: throw new ArgumentOutOfRangeException("region"); } }
private void ShowPopup(PopupRegion region, FrameworkElement content) { switch (region) { case PopupRegion.AppToolBarRight: this.DisposePopupContent(this.AppToolBarRightPopup); this.AppToolBarRightPopup.VerticalOffset = 0; this.AppToolBarRightPopup.Child = content; this.AppToolBarRightPopup.Width = content.Width; this.AppToolBarRightPopup.Height = content.Height; this.AppToolBarRightPopup.IsOpen = true; break; case PopupRegion.AppToolBarLeft: this.DisposePopupContent(this.AppToolBarLeftPopup); this.AppToolBarLeftPopup.VerticalOffset = 0; this.AppToolBarLeftPopup.Child = content; this.AppToolBarLeftPopup.Width = content.Width; this.AppToolBarLeftPopup.Height = content.Height; this.AppToolBarLeftPopup.IsOpen = true; break; case PopupRegion.Full: this.DisposePopupContent(this.FullScreenPopup); this.FullScreenPopup.Child = content; this.UpdateFullScreenPopupSize(); this.FullScreenPopup.IsOpen = true; this.UpdateBottomAppBarVisibility(); this.UpdateTopAppBarVisibility(); ((Storyboard)this.Resources["ActivateFullScreenPopup"]).Begin(); break; default: throw new ArgumentOutOfRangeException("region"); } }