Month: September 2016
-
XamarinForms – Overriding PageRenderer and NavigationService
After further implementation on my pet project, I realized that my previous solution on the page renderers would cause the NavigationService to fail from going back. So with more experimentation, I’ve discovered a way to preserve that functionality and still allow the page renderers to override the default view functionality. using Xamarin.Forms; using Xamarin.Forms.Platform.Android; [assembly:…
-
XamarinForms – Overriding a ContentPage with a custom PageRenderer on Android
The short version: If you want to have default behavior on all platforms except for Android. Do the following Create your content page with all of it’s goodies Create a custom PageRenderer In the OnElementChanged function Cast the Context property of the renderer to the Activity type associated Take that value and execute the SetContentView method while passing…
-
C# – How the Null Conditional Operator works with Nullable types
The short answer: The null conditional operator also unwraps the nullable variable. So after the operator, the “Value” property is no longer needed. ex: DateTimeOffset? startAt; … System.Writeline(startAt?.TimeOfDay); The longer story: I had a scenario with a Nullable DateTimeOffset and I was trying to perform something like the following. DateTimeOffset? startAt; … public DateTime? StartDate { get…