Skip to content

Instantly share code, notes, and snippets.

View JoeM-RP's full-sized avatar
🛰️
Broadcasting live from geosynchronous orbit over Chicago

Joe Meyer JoeM-RP

🛰️
Broadcasting live from geosynchronous orbit over Chicago
View GitHub Profile
@JoeM-RP
JoeM-RP / -Templates.README.md
Last active April 30, 2018 20:09
Visual Studio Mac Snippets

README

To reuse templates simply copy these files to the appropriate location

VS Mac

~Library/VisualStudio/<version>/Snippets

VS Windows

%AppData%\VisualStudio\<version>\Snippets

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="samples.core.Views.RadioButtonView" xmlns:behaviors="clr-namespace:samples.core.Behaviors" Title="Radio Buttons">
<ListView x:Name="ListView_Radio" ItemTapped="Handle_ItemTapped" ItemSelected="Handle_ItemSelected" IsGroupingEnabled="true" HasUnevenRows="true">
<!-- Group Header -->
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="{StaticResource MediumGray}">
<Label Margin="14,0" Text="{Binding Key}" FontSize="Large" VerticalOptions="CenterAndExpand"/>
</StackLayout>
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace samples.core.Models
{
public class RadioOption : INotifyPropertyChanged
{
public RadioCategory Category { get; }
public string Title { get; }
<?xml version="1.0" encoding="utf-8"?>
<prism:PrismApplication xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="PrismForms.App" xmlns:prism="clr-namespace:Prism.DryIoc;assembly=Prism.DryIoc.Forms">
<prism:PrismApplication.Resources>
<!-- Application resource dictionary -->
<ResourceDictionary>
</ResourceDictionary>
</prism:PrismApplication.Resources>
</prism:PrismApplication>
<?xml version="1.0" encoding="UTF-8"?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="PrismForms.Views.AppShell"
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
prism:ViewModelLocator.AutowireViewModel="True">
<MasterDetailPage.Master>
<!-- Be mindful of the Title and Icon properties; they are required -->
<NavigationPage Title="Required" Icon="slideout.png" BarTextColor="White" BarBackgroundColor="#87A3BA">
<x:Arguments>
using System;
using System.Collections.Generic;
using Prism.Navigation;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
namespace PrismForms.Views
{
public partial class AppShell : MasterDetailPage, IMasterDetailPageOptions
{
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="PrismForms.Views.HomePage" xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" prism:ViewModelLocator.AutowireViewModel="True" Title="{Binding Title}">
<ContentPage.Content>
<StackLayout Padding="10,20">
<ListView SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemsSource="{Binding CopyItems}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Title}" />
</DataTemplate>
</ListView.ItemTemplate>
@JoeM-RP
JoeM-RP / Program.cs
Last active June 20, 2018 14:37
EddystoneGenerator
using System;
namespace EddystoneGenerator
{
class MainClass
{
public static void Main(string[] args)
{
Random random = new Random();
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="samples.core.Views.EntryMoveNextView"
xmlns:ctrl="clr-namespace:samples.core.Controls;assembly=samples.core">
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Name="MyEntry" TargetType="Entry">
<Setter Property="HeightRequest" Value="45" />
</Style>
using System;
using CoreGraphics;
using samples.core.Controls;
using samples.iOS.Effects;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportEffect(typeof(EntryMoveNextEffect), nameof(EntryMoveNextEffect))]
namespace samples.iOS.Effects