Skip to content

Instantly share code, notes, and snippets.

View programmation's full-sized avatar

David Dancy programmation

View GitHub Profile
import SwiftUI
struct ContentView1: View {
@State var cond = false
var body: some View {
ZStack {
Color.blue.opacity(cond ? 0.2 : 0.7)
Test(cond: cond)
}
.onTapGesture {
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using ICountingTransform = Messaging.ITransform<Messaging.CountingMessage, Messaging.CountingState>;
using ICountingSideEffect = Messaging.ISideEffect<Messaging.CountingView, Messaging.CountingMessage, Messaging.CountingState>;
namespace Messaging
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Messaging
{
class Program
{
static void Main(string[] args)
using System;
using System.Linq;
using System.Threading.Tasks;
namespace EventActionFunc
{
public class Program
{
static async Task Main(string[] args)
{
using System;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using Nito.AsyncEx;
namespace Core.Utility
{
public abstract class BaseOperation<TInput, TOutput>
{
public TaskCompletionSource<TOutput> TaskCompletionSource { get; }
@programmation
programmation / FrameworkInterface.cs
Last active August 3, 2018 03:32
Framework defaults by Interface extensions
using System;
using System.Drawing;
// adapted from https://stackoverflow.com/a/37980328
namespace FrameworkInterface
{
public class Program
{
public static void Main(string[] args)
// from https://forums.xamarin.com/discussion/comment/168974/#Comment_168974
public class BindableToolbarItem : ToolbarItem
{
public static readonly BindableProperty IsVisibleProperty =
BindableProperty.Create("IsVisible", typeof (bool), typeof (BindableToolbarItem),
true, BindingMode.TwoWay, propertyChanged: OnIsVisibleChanged);
public BindableToolbarItem()
{
@programmation
programmation / XamarinStartup.cs
Created August 6, 2017 23:39
Configure Xamarin app to use device culture
// from https://forums.xamarin.com/discussion/100540/set-default-culture-to-culture-of-device
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(CultureInfo.CurrentUICulture.ToString());
// from https://forums.xamarin.com/discussion/comment/279890/#Comment_279890
public partial class GradientView : ContentView
{
public Color StartColor { get; set; } = Color.Transparent;
public Color EndColor { get; set; } = Color.Transparent;
public bool Horizontal { get; set; } = false;
public GradientView()
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
namespace MyNamespace