Aneesh.A.M
Aneesh.A.M

Reputation: 1148

Disable user interaction to current page

In my Xamarin forms application I want to disable the user interaction to current page when displaying a custom popup. How can I block user interaction to the toolbar also. User cannot touch the toolbar when showing the default alert box using the following method

DisplayAlert(...); But i am using a custom popup. Please help me.

Upvotes: 2

Views: 3912

Answers (2)

Noor Ali Butt
Noor Ali Butt

Reputation: 817

this.Content.IsEnabled = false;

It would turn off touch for all the content.

Upvotes: 1

JordanMazurke
JordanMazurke

Reputation: 1123

The most MVVM way would be to bind the IsEnabled property to a boolean value in your viewModel. On showing the popup you could toggle the value to false and then revert on dismissing the popup:

var label = new Label();
label.setBinding<ViewModel>(Label.IsEnabledProperty, vm=>vm.IsEnabledToggle);

Upvotes: 0

Related Questions