Instead of the verbose setOnClickListener:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)| public static readonly BindableProperty $Name$Property = | |
| BindableProperty.Create<$owner$, $type$>( | |
| p => p.$Name$, default($type$)); | |
| public $type$ $Name$ { | |
| get { return ($type$)GetValue($Name$Property); } | |
| set { SetValue($Name$Property, value); } | |
| } |
| public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) | |
| { | |
| var view = base.OnCreateView(inflater, container, savedInstanceState); | |
| var recyclerView = view.FindViewById<RecyclerView>(Resource.Id.my_recycler_view); | |
| if (recyclerView != null) | |
| { | |
| recyclerView.HasFixedSize = true; | |
| var layoutManager = new LinearLayoutManager(Activity); |
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
| import android.app.Activity; | |
| import android.app.Fragment; | |
| import android.app.FragmentManager; | |
| #parse("File Header.java") | |
| public class ${NAME} extends Fragment { | |
| private static final String FRAG_TAG = ${NAME}.class.getCanonicalName(); |
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2014 Konstantin Mikheev sirstripy-at-gmail-com | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using MonoTouch.MessageUI; | |
| using MonoTouch.UIKit; | |
| namespace MyApp | |
| { | |
| public interface ICanCleanUpMyself | |
| { |
| public static T DequeueReusableCell<T> (this UITableView tableView) where T : UITableViewCell | |
| { | |
| var identifier = typeof(T).Name; | |
| var cell = tableView.DequeueReusableCell (identifier); | |
| if (cell == null) | |
| { | |
| // Nib with the class name MUST exist in the name bundle | |
| var nib = UINib.FromName (identifier, NSBundle.MainBundle); | |
| tableView.RegisterNibForCellReuse (nib, identifier); |
| public static class DateTimeHelper | |
| { | |
| private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); | |
| public static DateTime UnixTimeToDateTime(string text) | |
| { | |
| double seconds = double.Parse(text, CultureInfo.InvariantCulture); | |
| var time = Epoch.AddSeconds(seconds); | |
| return time; |
| public static class SQLiteExtensions | |
| { | |
| /// <summary> | |
| /// Save the specified entity by calling insert or update, if the entity already exists. | |
| /// </summary> | |
| /// <param name="pk">The primary key of the entity</param> | |
| /// <param name="obj">The instance of the entity</param> | |
| /// <typeparam name="T">The entity type.</typeparam> | |
| public static int Save<T>(this SQLiteConnection db, object pk, object obj) where T : class, new() | |
| { |
| /* | |
| Snippet Name: InlineTableViewSource | |
| Platform: iOS | |
| Function: A subclass of UITableViewSource that allows you to define UITableViewDataSource and UITableViewDelegate methods inline, rather than subclassing. Lets you take advantage of closures and use tableviews where you can't create subclasses, like in Xamarin Sketches (compile and reference). | |
| Funcs/Actions are prefixed with "_", feel free to alter if this disagrees with your styling guidelines. | |
| Usage: | |
| var cellId = new NSString("cell"); |