Skip to content

Instantly share code, notes, and snippets.

View teamtam's full-sized avatar
💭
Xamarin by day, Flutter by night

Benjamin Tam teamtam

💭
Xamarin by day, Flutter by night
View GitHub Profile
@teamtam
teamtam / ViewLocationExpander.cs
Last active September 19, 2017 03:00
ASP.NET Core customisation for arranging views vertically by feature
public class ViewLocationExpander : IViewLocationExpander
{
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
{
string[] locations = new string[]
{
"~/Features/{1}/{0}.cshtml",
"~/Features/Shared/{0}.cshtml",
};
return locations;
@teamtam
teamtam / UriImageLoaderIos.cs
Created February 8, 2017 00:19
Manipulates a URI to get a resolution appropriate image by convention (for iOS) before calling Xamarin.Forms.ImageSource.FromUri(...)
public class UriImageLoaderIos : IUriImageLoader
{
public string GetUri(string baseImageUri)
{
if (string.IsNullOrEmpty(baseImageUri))
{
throw new ArgumentNullException("baseImageUri");
}
if (UIScreen.MainScreen.Scale > 2.0)
{