Skip to content

Instantly share code, notes, and snippets.

View roubachof's full-sized avatar
🏠
Working from home

Jean-Marie Alfonsi roubachof

🏠
Working from home
View GitHub Profile
@softlion
softlion / BaseViewModel.cs
Last active February 26, 2016 13:49
ShowViewModelAsync and InvokeOnMainThreadAsync for MvvmCross. Also adds OnBack/OnBack2 methods on viewmodels.
public class BaseViewModel : MvxViewModel, IBackViewModel
{
#region InvokeOnMainThreadAsync
protected Task InvokeOnMainThreadAsync(Action action)
{
var tcs = new TaskCompletionSource<bool>();
if (Dispatcher != null)
{
Dispatcher.RequestMainThreadAction(() =>
{
@softlion
softlion / MvxSpinner2.cs
Created April 2, 2016 08:17
mvvmcross MvxSpinner support for material design (using AppCompatSpinner)
using System;
using System.Collections;
using System.Windows.Input;
using Android.Content;
using Android.Runtime;
using Android.Support.V7.Widget;
using Android.Util;
using MvvmCross.Binding.Attributes;
using MvvmCross.Binding.Droid.Views;