Skip to content

Instantly share code, notes, and snippets.

using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls.Effects
{
[Preserve(AllMembers = true)]
public class AttachedStateEffect : RoutingEffect
{
public enum AttachedState
{
@PureWeen
PureWeen / ReactiveRouting.cs
Last active May 19, 2018 04:12
RxUI Routing
public interface IParScreen
{
/// <summary>
/// The Router associated with this Screen.
/// </summary>
IParRoutingState Router { get; }
}
public interface IParRoutingState
{

TouchGestureRecognizer

Generic Touch Gesture Recognizer

Whenever a touch state changes this Gesture Recognizer will fire an Updated event. This allows for a raw feed of touch data that a user could essentially use for anything.

API

Supporting APIs

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using Xamarin.Forms;
public delegate void RepeaterViewItemAddedEventHandler(object sender, RepeaterViewItemAddedEventArgs args);
/// <summary>
@PureWeen
PureWeen / build.sh
Last active November 23, 2020 07:40
Building Xamarin Forms on Mac
#!/bin/bash
# If you are on Visual Studio for Mac 2017 Turn off automatic package restore before running this script
# If you are on Visual Studio for Mac 2019 you do not need to turn off automatic package restore
# Visual Studio => Preferences => Nuget => General => uncheck the Package Restore box
# Needing to turn restore off isn't necessary in the latest preview releases of VS Mac
# Clean
git clean -dxf
@PureWeen
PureWeen / BorderDrawable.cs
Last active December 20, 2018 23:21
Border Drawable
using System;
using System.Linq;
using Android.Graphics;
using Android.Graphics.Drawables;
using AColor = Android.Graphics.Color;
namespace Xamarin.Forms.Platform.Android
{
internal class BorderDrawable : Drawable
{
@PureWeen
PureWeen / RoutingUri.md
Last active April 11, 2019 22:57
Routing URI Spec
Relative push - edit
Relative replace - \\edit
absolute push - \edit or if your shell route is unique shell\edit
absolute replace - \\\edit or if your shell route is unique \\shell\edit

Route construction and GoToAsync behavior

Api Changes

@PureWeen
PureWeen / shellstructures.md
Last active June 4, 2024 07:05
Shell XAML Structures

Existing Structures

This is only showing browsable areas and just assume there's always a shell parent

Core Control => Aliases

  • ShellItem (Design Hidden) => FlyoutItem and TabBar
    • ShellSection (Design Hidden) => Tab (Bottom Tabs)
      • ShellContent => (Top Tabs represents)

Navigation note(s)

  • Pushing global route pages happens at the Shell Section Level. So if you push a page onto the stack you've left that Shell Section and that Shell section (with its top tabs) is now one level down in the stack.
@PureWeen
PureWeen / ShellNavigation.md
Last active June 11, 2019 04:31
Spec for shell navigation hooks

Shell Navigation interfaces

Existing work being done here xamarin/Xamarin.Forms#6383

Notes

The intent of this setup is to empower MVVM frameworks to effectively influence every aspect of shell processing a Uri. ShellRouteState represents the data object that Shell understands but MVVM frameworks can effectively implement there own uri scheme with the above set of interfaces. People can also just tap into parts of the process if they only want to influence one or two things.

public FormsView
{
  Func<Point, bool> _setInitialTransformationCallBack;
  
  // could hide this behind explicit interface
  public void RegisterCallBack(Func<Point, bool> callback)
  {
    _setInitialTransformationCallBack = callback;
  }