Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am chrisway on github.
  • I am chrisway (https://keybase.io/chrisway) on keybase.
  • I have a public key ASAP4u2TMUewuTMVXyRuNkbJJ-KZQATjZ-X2LmVe49GKxgo

To claim this, I am signing this object:

package md5fa22044078b50743372e010f51d93dc4;
public class ScrollAwareFABBehavior
extends android.support.design.widget.FloatingActionButton.Behavior
implements
mono.android.IGCUserPeer
{
static final String __md_methods;
static {
@ChrisWay
ChrisWay / NetNaming.cs
Last active August 29, 2015 14:24
Converts a string into a format that matches .NET naming conventions.
private static string ToNetNaming(string input)
{
bool wasPreviousUpper = false;
bool isNextUpper = false;
var inputArray = input.ToCharArray();
var output = input.ToCharArray();
for (int i = 0; i < inputArray.Length; i++)
{
if (i != 0) {
@ChrisWay
ChrisWay / AppBootstrapper
Created December 11, 2014 14:27
XamForms Tabs
public Page CreateMainPage()
{
var tabs = new TabbedPage();
var vm1 = new SiteListViewModel(); // Implements IScreen
var tab1 = new RoutedViewHost();
tab1.Router = vm1.Router;
vm1.Router.Navigate.Execute(vm1);
tabs.Children.Add(tab1);
@ChrisWay
ChrisWay / KeyDownHandler.cs
Created November 6, 2013 09:21
Fix for XamDataGrid Issue GetAncestor just walks the visual tree looking for Parent of the given type.
public void KeyDownHandler(object sender, KeyEventArgs e)
{
var cb = (ComboBox)sender;
if (e.Key != Key.Tab || !cb.IsDropDownOpen)
return;
var item = (ComboBoxItem)FocusManager.GetFocusedElement(FocusManager.GetFocusScope(cb));
cb.SelectedItem = item.Content;
cb.IsDropDownOpen = false;
@ChrisWay
ChrisWay / MainWindow.cs
Created September 25, 2013 08:22
XamDataGrid issue
using System;
using System.ComponentModel;
using System.Windows;
namespace DataGridTest
{
public partial class MainWindow : Window
{
public MainWindow()
{
@ChrisWay
ChrisWay / HtmlHelpers.cs
Last active August 29, 2018 06:34
ASP.NET MVC - Twitter Bootstrap navbar link helper
using System.Web.Mvc.Html;
public static class HtmlHelpers
{
public static MvcHtmlString MenuLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName)
{
var currentAction = htmlHelper.ViewContext.RouteData.GetRequiredString("action");
var currentController = htmlHelper.ViewContext.RouteData.GetRequiredString("controller");
var builder = new TagBuilder("li")
@ChrisWay
ChrisWay / MyViewWithGrid.cs
Created August 28, 2012 10:48
XamDataGrid - Setting keyboard focus back to Add row
//Add a PreviewKeyDown event handler to the data grid and call the HandleFocus method.
private void DataGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
XamDataGridFocusHelper.HandleFocus(sender, e);
}