Skip to content

Instantly share code, notes, and snippets.

Avatar

Vincent Hoogendoorn VincentH-Net

View GitHub Profile
@VincentH-Net
VincentH-Net / .editorconfig
Created July 4, 2022 17:21
.editorconfig naming rule for NO underscore prefix on private fields
View .editorconfig
# Start of NO underscore prefix on private fields
# Define the 'private_fields' symbol group:
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
# Define the 'notunderscored' naming style
dotnet_naming_style.notunderscored.capitalization = camel_case
dotnet_naming_style.notunderscored.required_prefix =
# Define the 'private_fields_notunderscored' naming rule
@VincentH-Net
VincentH-Net / RegistrationCodePage.cs
Last active April 4, 2022 18:47
C# language proposal examples for UI markup #CSharpForMarkup
View RegistrationCodePage.cs
// C# vNext markup friendly
enum Row { Icon, Prompt, Header, Entry }
void Build() => Content = new Grid
{
RowDefinitions = Rows.Define(
(Icon , Auto),
(Prompt, Auto),
(Header, 50 ),
(Entry , Auto)
@VincentH-Net
VincentH-Net / WhiteIBeam1.cape
Last active October 2, 2017 10:12
White IBeam cursor to fix mouse visibility in Visual Studio for Mac text editor on dark backgrounds. To use, first install https://github.com/alexzielenski/Mousecape/releases/tag/0.0.5 and then doubleclick .cape file (icon source: https://github.com/egold/better-xcode-ibeam-cursor)
View WhiteIBeam1.cape
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Author</key>
<string>Vincent Hoogendoorn</string>
<key>CapeName</key>
<string>WhiteIBeam</string>
<key>CapeVersion</key>
<real>1</real>
@VincentH-Net
VincentH-Net / SharpSvgImageSource.cs
Last active March 20, 2017 15:33
Temporary fix for unsharp SVG's in FFImageLoading
View SharpSvgImageSource.cs
using FFImageLoading;
using FFImageLoading.Config;
using FFImageLoading.DataResolvers;
using FFImageLoading.Forms;
using FFImageLoading.Svg.Platform;
using FFImageLoading.Work;
using SkiaSharp;
using System;
using System.IO;
using System.Reflection;
@VincentH-Net
VincentH-Net / ApiModels2ViewModels.cs
Last active July 13, 2016 13:26
Backend For FrontEnd API for Xamarin Apps
View ApiModels2ViewModels.cs
using System.Threading.Tasks;
using PropertyChanged;
/// <summary>
/// See "Consuming the BFF API" in http://vincenth.net/blog/archive/2016/07/13/building-bff-backend-for-frontend-apis-for-xamarin-mobile-apps.aspx
/// </summary>
namespace MyApp.ApiModels
{
[ImplementPropertyChanged] // This will make all properties in all partial Contact classes data-bindable
public partial class Contact : ViewModelBase
@VincentH-Net
VincentH-Net / FormsBinding.sketchcs.cs
Last active March 21, 2016 18:09
Xamarin Forms Sketch demonstrating data binding (without strings, to nested objects, to unlimited number of fields) and common app/sketch code. Note: remove the .cs from the file name, it is only there to make GitHub format it as C#
View FormsBinding.sketchcs.cs
using Xamarin.Forms;
// Additional guidance: see http://vincenth.net/blog/archive/2014/11/27/how-to-share-xamarin-forms-data-binding-code-across-xamarin-sketches-and-apps-without-using-strings.aspx
// NOTE: Once support for creating classes is added to Xamarin Sketches,
// there is no need for this Tuple + enum + BindName + regular expression workaround;
// you can then simply create design data classes in the Sketch and bind to that using
// the same syntax in both projects and sketches, e.g.:
// SetBinding(..., (Person boundPerson) => boundPerson.Name)
// BindName helper function for use with binding to design data in Sketches.
@VincentH-Net
VincentH-Net / KeyboardDismissGestureRecognizer.cs
Created January 10, 2014 13:52
KeyboardDismissGestureRecognizer automatically dismisses the onscreen keyboard in Xamarin.iOS when a user taps outside an editable view. Simply add a KeyboardDismissGestureRecognizer to your application's main window in FinishedLaunching.
View KeyboardDismissGestureRecognizer.cs
/// <summary>
/// To automatically dismiss the onscreen keyboard in iOS when a user taps outside an editable view,
/// add a KeyboardDismissGestureRecognizer to your application's main window in FinishedLaunching, e.g.:
/// Window.AddGestureRecognizer(new KeyboardDismissGestureRecognizer());
/// </summary>
public class KeyboardDismissGestureRecognizer : UITapGestureRecognizer
{
public KeyboardDismissGestureRecognizer() : base(() => { }) { CancelsTouchesInView = false; }
public override void TouchesBegan(NSSet touches, UIEvent evt)
@VincentH-Net
VincentH-Net / OrderResultView.axml
Created October 24, 2013 12:37
OrderResult view markup for Android Cloud Auction example app, built with MvvmQuickCross
View OrderResultView.axml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/OrderResultView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@VincentH-Net
VincentH-Net / TextListItem.axml
Created October 24, 2013 09:23
Simple text list item view markup for Android Cloud Auction example app, built with MvvmQuickCross
View TextListItem.axml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/TextListItem"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
@VincentH-Net
VincentH-Net / OrderView.axml
Created October 24, 2013 08:45
Order view markup for Android Cloud Auction example app, built with MvvmQuickCross
View OrderView.axml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/OrderView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<TableLayout
android:stretchColumns="1,2"
android:layout_width="fill_parent"
android:layout_height="fill_parent">