Skip to content

Instantly share code, notes, and snippets.

View roubachof's full-sized avatar
🏠
Working from home

Jean-Marie Alfonsi roubachof

🏠
Working from home
View GitHub Profile
@roubachof
roubachof / ScrollAware.cs
Created September 22, 2023 08:45
ScrollAware attached properties to implement reveal on scroll UX (twitter, facebook, ...)
using System.Diagnostics.CodeAnalysis;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System;
using System.Diagnostics;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Animation;
namespace Uno.Toolkit.UI;
@roubachof
roubachof / DelayedWithFactory.cs
Last active September 12, 2023 09:28
Delayed view with factory
namespace Sharpnado.Lazy
{
using System;
using System.Threading.Tasks;
using Prism;
using Sharpnado.Tabs;
using Sharpnado.Tasks;
using System;
using System.Threading.Tasks;
using Sharpnado.Tabs;
using Sharpnado.Tasks;
using Xamarin.Forms;
namespace Sharpnado.Presentation.CustomViews
{
public class DelayedView<TView> : LazyView<TView>
where TView : View, new()
@roubachof
roubachof / App.xaml.cs
Created December 24, 2021 15:56
Prism Navigation service with exceptions raised
namespace MyCompany
{
public partial class App
{
public App(IPlatformInitializer initializer)
: base(initializer)
{
}
protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)
@roubachof
roubachof / RatingView.cs
Last active October 27, 2021 09:07
RatingView in SkiaSharp
// ****************************************************************************
// Copyright (c) 2017 Clovis Nicolas, fixed by JM Alfonsi
// https://github.com/clovisnicolas/SkiaRate
// ****************************************************************************
// This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
// <auto-generated/>
using System;
using SkiaSharp;
using SkiaSharp.Views.Forms;
@roubachof
roubachof / Settings.XamlStyler
Last active February 6, 2020 14:49
XamlStyler json config file supporting all the `Xamarin.Forms` attributes for all my projects and decided to share it with you. So you won't start from nothing :)
{
"AttributesTolerance": 2,
"KeepFirstAttributeOnSameLine": true,
"MaxAttributeCharactersPerLine": 0,
"MaxAttributesPerLine": 1,
"NewlineExemptionElements": "RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransfom, SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter",
"SeparateByGroups": false,
"AttributeIndentation": 0,
"AttributeIndentationStyle": 1,
"RemoveDesignTimeReferences": false,
@roubachof
roubachof / Paginator.cs
Last active September 15, 2019 06:32
Standalone version of the Sharpnado.Presentation.Forms paginator (it has no dependencies). It is totally crossplatform.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace Sharpnado.Presentation.Paging
{
/// <summary>
/// Interface IInfiniteListLoader.
@roubachof
roubachof / AnchorBottomSheetBehavior.DragCallback.cs
Last active May 12, 2019 19:07
Xamarin Android - Google maps bottom sheet behavior, a BottomSheetBehavior with an added state - Xamarin port of google BottomSheetStyle
using System;
using Android.Support.V4.View;
using Android.Support.V4.Widget;
using Android.Views;
using Debug = System.Diagnostics.Debug;
namespace SillyCompany
{
public enum AnchorBottomSheetState
@roubachof
roubachof / App.cs
Last active April 13, 2016 08:03
MvxForms MasterDetail
using MvvmCross.Forms.Presenter.Core;
using Stago.Mhp.Instr.Pocm.Core.Views;
using Xamarin.Forms;
namespace Stago.Mhp.Instr.Pocm.Core
{
public partial class App : MvxFormsApp
{
public App()
@roubachof
roubachof / TcpListenerLogServer.cs
Last active June 28, 2016 11:43
Script and tcp server listening to log results with NUnit.Xamarin 3 with TcpWriterParameters option (https://github.com/nunit/nunit.xamarin)
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using Mono.Options;
namespace Company.Whatever.UnitTests.Droid.Server
{