Skip to content

Instantly share code, notes, and snippets.

View gshackles's full-sized avatar

Greg Shackles gshackles

View GitHub Profile
@gshackles
gshackles / gist:1872574
Created February 21, 2012 00:37
async sample
using System;
using System.Threading;
using System.Threading.Tasks;
using Android.App;
using Android.Widget;
using Android.OS;
namespace MonoAndroidApplication18
{
[Activity(Label = "MonoAndroidApplication18", MainLauncher = true, Icon = "@drawable/icon")]
@gshackles
gshackles / gist:2723016
Created May 18, 2012 03:39
create a shortcut to the app on the homescreen
using System;
using Android.App;
using Android.Content;
using Android.OS;
[assembly: UsesPermission("com.android.launcher.permission.INSTALL_SHORTCUT")]
namespace AndroidApplication6
{
[Activity(Label = "AndroidApplication6", MainLauncher = true, Icon = "@drawable/icon")]
@gshackles
gshackles / AppDelegate.cs
Created July 29, 2012 02:45
SignalR - MonoTouch - AppDelegate.cs
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
namespace SignalR.Client.MonoTouch.Sample
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow window;
@gshackles
gshackles / Main.axml
Created July 29, 2012 02:51
SignalR - MonoDroid - Main.axml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/Message" />
<Button
@gshackles
gshackles / DemoActivity.cs
Created July 29, 2012 02:51
SignalR - MonoDroid - DemoActivity.cs
using System.Collections.Generic;
using Android.App;
using Android.OS;
using Android.Widget;
namespace SignalR.Client.MonoDroid.Sample
{
[Activity(Label = "SignalR.Client.MonoDroid.Sample", MainLauncher = true, Icon = "@drawable/icon")]
public class DemoActivity : Activity
{
PS C:\code> mulder create site mulder-test
create config.yaml
create Rules
create layouts\default.html
Error
Message: Operation could destabilize the runtime.
Source: Mulder
Stack Trace: at (Object )
at Mulder.Base.Extensions.AnonymousTypeExtensions.AnonymousTypeConverter.ConvertToDictionary(Object model)
public abstract class ViewModelBase
: MvxViewModel,
IMvxServiceConsumer<ITinyMessengerHub>
{
protected ViewModelBase()
{
MessengerHub = this.GetService<ITinyMessengerHub>();
}
protected ITinyMessengerHub MessengerHub { get; private set; }
public class SubNavigationResultMessage<TResult> : TinyMessageBase
{
public TResult Result { get; private set; }
public string MessageId { get; set; }
public SubNavigationResultMessage(object sender, string messageId, TResult result)
: base(sender)
{
Result = result;
MessageId = messageId;
public abstract class SubViewModelBase<TResult> : ViewModelBase
{
protected string MessageId { get; private set; }
protected SubViewModelBase(string messageId)
{
MessageId = messageId;
}
protected void Cancel()
protected bool RequestSubNavigate<TViewModel, TResult>(IDictionary<string, string> parameterValues, Action<TResult> onResult)
where TViewModel : SubViewModelBase<TResult>
{
parameterValues = parameterValues ?? new Dictionary<string, string>();
if (parameterValues.ContainsKey("messageId"))
throw new ArgumentException("parameterValues cannot contain an item with the key 'messageId'");
string messageId = Guid.NewGuid().ToString();