I am following a Xamarin Example with my code:
public App()
{
InitializeComponent();
DeviceDisplay.MainDisplayInfoChanged += OnMainDisplayInfoChanged;
}
void OnMainDisplayInfoChanged(DisplayInfoChangedEventArgs e)
{
var displayInfo = e.DisplayInfo;
}
As far as I can see this is just the same as in this example:
https://learn.microsoft.com/en-us/xamarin/essentials/device-display?context=xamarin%2Fios&tabs=uwp
But it is giving me the error message:
App.xaml.cs(13,13): Error CS0123: No overload for 'OnMainDisplayInfoChanged' matches delegate 'EventHandler' (CS0123)
Can anyone help explain to me what this error message means and let me know if there is a way for me to fix this?