Jina
Jina

Reputation: 99

disable any click on elements from the MainPage when a PopUp is launched

I want to display a PopUp in my C# universal app like this :

enter image description here but the problem,is that my PopUp deosn't work like this Frame that appears in the Groove App,per example,what I want is when I click on a button in the MainPage, it displays the PopUp then to disable the click on any element in the MainPage,the focus will be only on the elements of the Popup until the close of this PopUp is this possible?? thanks for help

Upvotes: 0

Views: 558

Answers (2)

Jay Zuo
Jay Zuo

Reputation: 15758

Actually, the "PopUp" you've seen in the Groove App is not a Popup. It's a AccountsSettingsPane. This class provides methods to show the accounts pane and also to enable the app to register callbacks when the accounts flyout is about to be displayed. For more information, please refer to the official Web account management sample in GitHub and especially the Single Microsoft Account scenario in this sample.

When using AccountsSettingsPane, if we use the ProcessMonitor to track this UI, we will find that it is a system app C:\Windows\SystemApps\Microsoft.AccountsControl_cw5n1h2txyewy. What happened here is similar to this case: UWP Modal Window. So you can refer to Launch an app for results to implement this behavior. But this requires you to create another app.

For ContentDialog, it can not be movable. If your content is not complex, you can try with MessageDialog class. This dialog is movable. For more info, please refer to Message dialog sample.

Upvotes: 0

ganchito55
ganchito55

Reputation: 3607

What you want is a modal window, for example you can create one with Content dialog.

 ContentDialog modalWindow = new ContentDialog()
 {
   Title = "youTitle",
   Content = "Content",
   PrimaryButtonText = "
 };
 await modalWindow.ShowAsync();

You can show more here

Upvotes: 0

Related Questions