Skip to content

Instantly share code, notes, and snippets.

View aloisdeniel's full-sized avatar
🤘
Flutter / Figma

Aloïs Deniel aloisdeniel

🤘
Flutter / Figma
View GitHub Profile
@aloisdeniel
aloisdeniel / gist:463440031a20f6f5e1e1
Last active August 29, 2015 14:18
Cloning all dependency properties of a UserControl
namespace App1
{
using System;
using System.Linq;
using Windows.UI.Xaml.Controls;
using System.Reflection;
using Windows.UI.Xaml;
using System.Collections.Generic;
public static class UserControlExtensions
@aloisdeniel
aloisdeniel / Animation Fade
Last active October 11, 2022 19:10
Xamarin.iOS view common animations
public static void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null)
{
var minAlpha = (nfloat)0.0f;
var maxAlpha = (nfloat)1.0f;
view.Alpha = isIn ? minAlpha : maxAlpha;
view.Transform = CGAffineTransform.MakeIdentity ();
UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut,
() => {
view.Alpha = isIn ? maxAlpha : minAlpha;