DualScreenInfo.Current.PropertyChanged will not trigger and DualScreenInfo.Current will not updated

Frequent Contributor

I'm currently trying to update me existing app to use the new awesome NuGet package Xamarin.Forms.DualScreen.


It worked in most of the places but the event DualScreenInfo.Current.PropertyChanged will not be valled and the values of DualScreenInfo.Current will not be updated if the app changes from single pane to dual pane (wide) mode.


Instead, only the OnAppearing() method will be called if I drag and drop the app between the screens.


Does anyone know what I'm missing that this behavior happens?



2 Replies
best response confirmed by tscholze (Frequent Contributor)

@tscholze Can you try adding 

| ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize

To your MainActivity on Android?

So you'll basically have something like this

[Activity(Label = "Control Gallery", Icon = "@drawable/icon", Theme = "@style/MyTheme",
MainLauncher = true, HardwareAccelerated = true, 
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]]
public partial class Activity1 : FormsAppCompatActivity


Great, thanks, it works now. I forgot two of the four Config values. :)