Skip to content

Instantly share code, notes, and snippets.

@jamesmontemagno
jamesmontemagno / MvxUIRefreshControl
Created August 23, 2013 19:36
MvvmCross Implementation of UIRefreshControl that you can use inside of TableViews or CollectionViews
using System;
using MonoTouch.UIKit;
using System.Windows.Input;
namespace com.refractored.mvxbindings
{
/// <summary>
/// Mvx user interface refresh control.
/// </summary>
public class MvxUIRefreshControl : UIRefreshControl
/// <summary>
/// Encrypt a string using AES
/// </summary>
/// <param name="clearString">String to encrypt</param>
/// <param name="salt">Salt string used for encryption</param>
/// <param name="password">Encryption password</param>
/// <returns>Encrypted string in case of success; otherwise - empty string</returns>
internal static string EncryptString(string clearString, string password, string salt)
{
@jamesmontemagno
jamesmontemagno / IRemove.cs
Last active November 16, 2021 08:46
A simple and Intuitive Xamarin.iOS + MvvmCross TableView swipe to delete implementation. This will allow you to have any number of ViewModels simply implement IRemove.cs and all you need is MvxDeleteStandarTableViewSource and implement the interface in your viewmodels! I should say that these are edited classes, you should implement some of the …
public interface IRemove
{
ICommand RemoveCommand { get; }
}
@jamesmontemagno
jamesmontemagno / Main.xml
Created November 15, 2013 17:46
Google Plust Login and +1 button Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="12dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
using System.Collections.Generic;
using Android.App;
using Android.Views;
using Android.Widget;
using DNR.Droid;
using DNR.Portable;
namespace DRN.Droid
{
using System.Collections.Generic;
using System.Drawing;
using MonoTouch.CoreAnimation;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.ImageIO;
using MonoTouch.UIKit;
namespace PuppyKittyOverflow.Touch
{
[04-Dec-2013 16:04:38] Command [Info: CommmandUrl=Info] finished (10)
[04-Dec-2013 16:04
:38] Handling with command: [StatusSdk: CommmandUrl=StatusSdk] (11)
[04-Dec-2013 16:04:38] Attempting to acquire command execution lock, timeout set to 00:10:00
[04-Dec-2013 16:04:42] Handling with command: [ListDevices: CommmandUrl=ListDevices] (12)
[04-Dec-2013 16:04:42] Attempting to acquire command execution lock, timeout set to 00:10:00
[04-Dec-2013 16:04:42] Command [ListDevices: CommmandUrl=ListDevices] finished (12)
[04-Dec-2013 16:05:14] Apple Docs need to be updated.
[04-Dec-2013 16:05:14] Command
vError 1 Binding is not supported in a Windows App project. C:\Users\Xamarin\Desktop\Demo Reset\DotNetRocks\code\DNR.Win\SplitPage.xaml 4 5 DNR.WinStore
Error 2 RelativeSource is not supported in a Windows App project. C:\Users\Xamarin\Desktop\Demo Reset\DotNetRocks\code\DNR.Win\SplitPage.xaml 4 5 DNR.WinStore
Error 3 Page is not supported in a Windows App project. C:\Users\Xamarin\Desktop\Demo Reset\DotNetRocks\code\DNR.Win\SplitPage.xaml 14 5 DNR.WinStore
Error 4 CollectionViewSource is not supported in a Windows App project. C:\Users\Xamarin\Desktop\Demo Reset\DotNetRocks\code\DNR.Win\SplitPage.xaml 17 9 DNR.WinStore
Error 5 Binding is not supported in a Windows App project. C:\Users\Xamarin\Desktop\Demo Reset\DotNetRocks\code\DNR.Win\SplitPage.xaml 19 13 DNR.WinStore
Error 6 Grid is not supported in a Windows App project. C:\Users\Xamarin\Desktop\Demo Reset\DotNetRocks\code\DNR.Win\SplitPage.xaml 29 5 DNR.WinStore
Error 7 StaticResource is not supported in a Windows App project. C:\Users\Xamarin\Desktop\D
/// <summary>
/// Checks if the operating system of the phone is 7.0 or higher
/// </summary>
/// <value><c>true</c> if is iOS7; otherwise, <c>false</c>.</value>
public static bool IsiOS7
{
get { return UIDevice.CurrentDevice.CheckSystemVersion (7, 0); }
}
User it like this:
using Newtonsoft.Json;
namespace TodoList.Portable
{
public class TodoItem
{
public string Id { get; set; }
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }