Skip to content

Instantly share code, notes, and snippets.

@deapsquatter
deapsquatter / MvxBindableGroupListAdaptor
Created January 31, 2013 11:11
Show a list with group headers similar to iOS UITableView with Sections. To use bind ItemsSource to an IEnumerable containing items that implement IEnumerable.
using System;
using Cirrious.MvvmCross.Binding.Droid.Views;
using System.Linq;
using Android.Content;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
namespace Cirrious.MvvmCross.Binding.Droid.Views
{
@deapsquatter
deapsquatter / gist:4701190
Created February 3, 2013 10:26
Example BindableGroupListView usage
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:centrastage="http://schemas.android.com/apk/res/CentraStage.Droid"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<DeapExtensions.Binding.Droid.Views.BindableGroupListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
@deapsquatter
deapsquatter / gist:4701238
Created February 3, 2013 10:39
ListItem_Profile
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:centrastage="http://schemas.android.com/apk/res/CentraStage.Droid"
android:paddingTop="2dip"
android:paddingBottom="2dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight">
<TextView
android:id="@+id/textProfileName"
public class DeviceBrowserVM : BaseViewModel
{
public ObservableCollection<Profile> SearchedProfiles
{
get{
return searchedDevices;
}
private set{
searchedDevices = value;
FirePropertyChanged("SearchedProfiles");
class Profile : IEnumerable<Device>
public MvxRelayCommand<Device> DeviceSelected {
get {
return new MvxRelayCommand<Device> ((device) =>
{
DataStore.AddToRecentlyUsed(device);
this.RequestNavigate<DeviceVM>(new { deviceUid = device.Id.ToString() }, true, new MvxRequestedBy());
});
}
}
@deapsquatter
deapsquatter / gist:4712983
Created February 5, 2013 08:07
Namespace Abbreviation
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:centrastage="http://schemas.android.com/apk/res/CentraStage.Droid"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<DeapExt.BindableGroupListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
using System;
using System.Collections.Concurrent;
namespace IOC
{
public sealed class IocContainer
{
ConcurrentDictionary<Type,Lazy<Object>> container = new ConcurrentDictionary<Type, Lazy<Object>>();
public static readonly IocContainer Default = new IocContainer();
interface IPullable
{
void Pull();
}
class Rope : IPullable
{
public void Pull()
{
Console.WriteLine("Pulled");
Interval Since Last Panic Report: 1397798 sec
Panics Since Last Report: 2
Anonymous UUID: CAAA47F4-A550-9EEA-8D53-DF93BA2B6326
Wed Mar 6 17:23:27 2013
panic(cpu 0 caller 0xffffff7f9f1efb25): NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd2000000 0xffffff8132709000 0x0a5480a2, D0, P3/4
Backtrace (CPU 0), Frame : Return Address
0xffffff810f6eaf70 : 0xffffff801ea1d626
0xffffff810f6eafe0 : 0xffffff7f9f1efb25
0xffffff810f6eb070 : 0xffffff7f9f2e94b3