I've just started a new Xamarin (Android & iOS) project in VS2019 and have been following this quick start guide to build a sample app.
One of the lines it asks you to add to App.xaml
is
<Thickness x:Key="PageMargin">20</Thickness>
However, IntelliSense immediately underlines it with the aforementioned error (error, not warning). Somehow it still builds (I thought errors were supposed to prevent builds?) and works as expected, so the erroneous error message has me confused.
Am I using an outdated parser? I've checked that all the Xamarin Nuget packages are up-to-date, and as stated I'm using Visual Studio 2019 so I don't see why it would have this problem.
Or is there a more modern way of writing this line? The tutorial is only a few months old...
You are trying to define a resource, and you could write this way as well:
<Thickness x:Key="PageMargin" Left="20" Top="20" Right="20" Bottom="20"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With