This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TableViewController : UITableViewController | |
| { | |
| static readonly NSString CellId = new NSString ("C"); | |
| readonly TableViewSource source = new TableViewSource (); | |
| readonly List<string> rows = new List<string> (); | |
| public override void ViewDidLoad () | |
| { | |
| base.ViewDidLoad (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static readonly BindableProperty $propertyName$Property = | |
| BindableProperty.Create("$propertyName$", typeof($propType$), typeof($controlType$), default($propType$)); | |
| public $propType$ $propertyName$ | |
| { | |
| get { return ($propType$)GetValue($propertyName$Property); } | |
| set { SetValue($propertyName$Property, value); } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Xamarin.Forms.Maps.Android; | |
| using Android.Gms.Maps; | |
| using Android.Gms.Maps.Model; | |
| using Xamarin.Forms; | |
| using CustomMapTiles; | |
| using CustomMapTiles.Droid.Renderers; | |
| [assembly: ExportRenderer (typeof (CustomMap), typeof (CustomMapRenderer))] | |
| namespace CustomMapTiles.Droid.Renderers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static UIImage Blur(this UIImage image, float blurRadius = 25f) | |
| { | |
| if (image != null) | |
| { | |
| // Create a new blurred image. | |
| var imageToBlur = new CIImage (image); | |
| var blur = new CIGaussianBlur (); | |
| blur.Image = imageToBlur; | |
| blur.Radius = blurRadius; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static UIColor ColorForRatio(float[] startColor, float[] endColor, float colorRatio) { | |
| return UIColor.FromRGB(startColor[0] + (endColor[0] - startColor[0]) * colorRatio, | |
| startColor[1] + (endColor[1] - startColor[1]) * colorRatio, | |
| startColor[2] + (endColor[2] - startColor[2]) * colorRatio); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static string ToSafeString(this object obj) | |
| { | |
| if (obj == null) | |
| { | |
| return string.Empty; | |
| } | |
| return obj.ToString(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static TValue GetValueOrDefault<TKey, TValue> (this IDictionary<TKey, TValue> dictionary, TKey key) | |
| { | |
| TValue ret; | |
| dictionary.TryGetValue(key, out ret); | |
| return ret; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Snippet Name: iOS Utils | |
| Platform: Xamarin.iOS | |
| Function: Check if running iOS 8, is phone, is tall, and envoke on UI Thread | |
| Snippet: | |
| public static class Utils | |
| { | |
| public static NSObject Invoker; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Xml; | |
| using System.Xml.Serialization; | |
| using MonoTouch.UIKit; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using MonoTouch.Foundation; | |
| /// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class CustomerFeelingSheet { | |
| public static Task<CustomerFeeling> ShowRatingDialogAsync(UIViewController parent) { | |
| var taskCompletionSource = new TaskCompletionSource<CustomerFeeling>(); | |
| var alert = UIAlertController.Create("howDoYouFeel".T(), null, UIAlertControllerStyle.ActionSheet); | |
| alert.AddAction(UIAlertAction.Create("likeIt".T(), UIAlertActionStyle.Default, | |
| a => taskCompletionSource.SetResult(CustomerFeeling.LikeIt))); | |
| alert.AddAction(UIAlertAction.Create("couldBeBetter".T(), UIAlertActionStyle.Default, | |
| a => taskCompletionSource.SetResult(CustomerFeeling.CouldBeBetter))); |