Skip to content

Instantly share code, notes, and snippets.

View edsnider's full-sized avatar
🎧
building apps

Ed Snider edsnider

🎧
building apps
View GitHub Profile
@edsnider
edsnider / SomeView.cs
Last active September 13, 2020 20:28
MvvmCross UIView Tap Command Binding
var set = this.CreateBindingSet<SomeView, SomeViewModel>();
// Use UIView Tap extension method in Cirrious.MvvmCross.Binding.Touch.Views.Gestures:
set.Bind (whateverLabel.Tap ())
.For (v => v.Command)
.To (vm => vm.WhateverCommand);
set.Apply();
@edsnider
edsnider / versionnumbers.rb
Created July 22, 2015 15:39
Get APK and IPA version numbers with Ruby
require 'ruby_apk'
require 'read_ipa'
# read version info from APK
apk = Android::Apk.new('<APK_FILENAME>.apk')
puts apk.manifest.version_name
puts apk.manifest.version_code
# read version info from IPA
@edsnider
edsnider / StaticTabs.xaml
Last active August 29, 2015 14:04
Static tabs in a Xamarin.Forms TabbedPage
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="StaticTabbedPageSample.Views.StaticTabs"
Title="Static Tabs Sample">
<TabbedPage.Children>
<ContentPage Title="Tab 1">
<StackLayout Orientation="Vertical" Padding="10,0">
<Label Text="This is the content for the first tab" />
<Button Text="Click here" />
@edsnider
edsnider / Beer.cs
Last active August 29, 2015 13:59
Windows Phone 8.1 SemanticZoom
namespace BeerGroups.Core.Models
{
public class Beer
{
public string Name { get; set; }
public string Brewery { get; set; }
public string Style { get; set; }
}
}
@edsnider
edsnider / BaseViewModel.cs
Last active August 29, 2015 13:58
Clearing WP back stack in MvvmCross
namespace MyApp.Portable.ViewModels
{
public class BaseViewModel : MvxViewModel
{
protected void ShowViewModelAndClearBackStack<TViewModel>()
where TViewModel : BaseViewModel
{
ShowViewModel<TViewModel>();
ChangePresentation(new ClearNavBackStackHint());
}