Xamarin.Forms Responsive Layout from Device Rotation

Intro This is a brain dump on implementing a responsive layout based on a device being in Portrait or Landscape mode. In summary, I used a ContentView's ControlTemplate to host a layout that depends on a device being in Portrait or Landscape mode. In addition, I then overrode the OnSizeAllocated method on the ContentPage. XAML …

Xamarin.Forms: Integrating Maps and Location Services

Intro Within Xamarn.Forms, we may find ourselves having to implement a feature that's dependent on a map and/or GPS. In order to implement this for Android and provide other controls to manage related services, we must implement a native Android page within our Xamarin.Forms app. In this post I will demonstrate how to load a …

Xamarin.Forms: Portable Class Library (PCL) and Code Coverage

.NET developers have used the [ExcludeFromCodeCoverage] attribute to focus validation on their business logic's code coverage. However, when building Xamarin.Forms applications, the [ExcludeFromCodeCoverage] attribute is not supported within the Portable Class Library. To workaround this issue, use the [DebuggerNonUserCode] attribute instead. Be aware that the debugger will be disabled for the code associated to this attribute. As a result, …

Xamarin.Forms: Unit Test a Confirmation Dialog

Intro It is absolutely essential to protect our code base from breaking changes. “We must protect this house!” One of the most important tests that need to be performed in software is testing user confirmations. Many professional debuggerers only know how to test this by launching the actual application to display a confirmation dialog. There …