Skip to content

Instantly share code, notes, and snippets.

View ChaseFlorell's full-sized avatar
🇨🇦

Chase Florell ChaseFlorell

🇨🇦
View GitHub Profile
using System;
using Cirrious.MvvmCross.Binding.Touch.Views;
using Cirrious.MvvmCross.Touch.Views.Presenters;
using FutureState.BreathingRoom.Touch.Ui.Controllers;
using FutureState.BreathingRoom.Touch.Ui.Fragments;
using MonoTouch.UIKit;
using SlidingPanels.Lib.PanelContainers;
namespace FutureState.BreathingRoom.Touch.Ui.Presenters
{
@ChaseFlorell
ChaseFlorell / BindableMarkdownView.cs
Last active February 9, 2016 23:47
Bindable Markdown View for use with MvvmCross (Mvx) on the Android and iOS platforms.
using System;
using Android.Content;
using Android.Util;
using Android.Webkit;
using MarkdownDeep;
namespace FutureState.Droid.Ui.Controls
{
public class BindalbeMarkdownView : WebView
{
@ChaseFlorell
ChaseFlorell / FragmentActivityBase.cs
Created May 7, 2014 13:50
Just trying to figure out how to better structure a FragmentActivity in order to reduce "noise" in the RootView
using System;
using Cirrious.CrossCore;
using Cirrious.MvvmCross.Droid.Fragging;
using Cirrious.MvvmCross.Droid.Fragging.Fragments;
using Cirrious.MvvmCross.ViewModels;
namespace FutureState.BreathingRoom.Droid.Ui.Views
{
internal class FragmentActivityBase : MvxFragmentActivity
{
@ChaseFlorell
ChaseFlorell / DrawerToggler.cs
Last active August 29, 2015 13:59
An Android Navigation Drawer that supports single and dual sliding drawers.
using System;
using Android.App;
using Android.Support.V4.App;
using Android.Support.V4.Widget;
using Android.Views;
namespace FutureState.BreathingRoom.Droid.Ui
{
public class ActionBarDrawerEventArgs : EventArgs
{
@ChaseFlorell
ChaseFlorell / snippet.cs
Created April 12, 2014 04:38
How to prevent icon slide on Right navigation drawer
public override void OnDrawerSlide(View drawerView, float slideOffset)
{
if (null != DrawerSlide)
DrawerSlide(this, new ActionBarDrawerEventArgs
{
DrawerView = drawerView,
SlideOffset = slideOffset
});
// only slide the left nav item
@ChaseFlorell
ChaseFlorell / FragmentActivityBase.cs
Last active August 29, 2015 13:58
Simple way to Show a Fragment from within an MvxFragmentActivity
using System;
using Cirrious.CrossCore;
using Cirrious.MvvmCross.Droid.Fragging;
using Cirrious.MvvmCross.Droid.Fragging.Fragments;
using Cirrious.MvvmCross.ViewModels;
namespace $NAMESPACE$
{
public class FragmentActivityBase : MvxFragmentActivity
{
'use strict';
/*
*usage: <markdown ng:model="box.content"></markdown>
*/
myApp.directive('markdown', function ($compile) {
var nextId = 0;
//Make converter only once to save a bit of load each time - thanks to ajoslin
var converter = new Markdown.Converter();
'use strict';
myApp.directive('backButton', function () {
return {
restrict: 'E',
link: function (scope, element, attrs) {
element.bind('click', goBack);
function goBack() {
@ChaseFlorell
ChaseFlorell / Cirrious.MvvmCross.ExternalAnnotations.xml
Last active August 29, 2015 13:57
Place this file beside the `Cirrious.MvvmCross.dll` file in each of the `lib` directories. Doing so will enable you to [alt] + [enter] (resharper) on an AutoProperty, and get the additional option "To property with change notification".
<?xml version="1.0" encoding="utf-8"?>
<assembly name="Cirrious.MvvmCross">
<member name="M:Cirrious.MvvmCross.ViewModels.MvxNotifyPropertyChanged.RaisePropertyChanged``1(System.Linq.Expressions.Expression{System.Func{``0}})">
<attribute ctor="M:JetBrains.Annotations.NotifyPropertyChangedInvocatorAttribute.#ctor" />
</member>
</assembly>
<!-- https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross/ViewModels/MvxNotifyPropertyChanged.cs#L40 -->
@ChaseFlorell
ChaseFlorell / DrawerToggler.cs
Last active December 31, 2015 06:39
Navigation Drawer Example
// THIS IS THE DRAWER TOGGLER CLASS THAT HANDLES THE TOGGLING.
public class ActionBarDrawerEventArgs : EventArgs
{
public View DrawerView { get; set; }
public float SlideOffset { get; set; }
public int NewState { get; set; }
}
public delegate void ActionBarDrawerChangedEventHandler(object s, ActionBarDrawerEventArgs e);