Skip to content

Instantly share code, notes, and snippets.

@PureWeen
PureWeen / ShellFlyoutHack.xaml
Last active May 15, 2020
ShellFlyoutHack.xaml
View ShellFlyoutHack.xaml
<Shell.ItemTemplate>
<DataTemplate>
<ContentView IsVisible="False"></ContentView>
</DataTemplate>
</Shell.ItemTemplate>
<!-- add these dynamically the Shell.Items ->
<MenuItem Text="Customer1 " Command="{Binding Command}" />
<MenuItem Text="Customer2 " Command="{Binding Command}" />
<MenuItem Text="Customer3 " Command="{Binding Command}" />
<MenuItem Text="Customer4 " Command="{Binding Command}" />
View FormsNavigationHelper.cs
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using Xamarin.Forms;
using TinyNavigationHelper.Abstraction;
namespace TinyNavigationHelper.Forms
View FusedLayout.md

Let's you base all layout measurements relatively against the layout properties of other views

Properties you can use to calculate against

public double X { get; set; } 
public double Width { get; set; } 
public double Right { get; set; } 
public double Left { get; set; } 
public double Y { get; set; } 
public double Height { get; set; }
@PureWeen
PureWeen / Xmas.md
Last active Dec 23, 2019
Xmas project
View Xmas.md
View Xmas.md
  • Install VSCode extension
@PureWeen
PureWeen / Alternative.md
Last active Dec 11, 2019
FlyoutItem and Tab Styling with Shell
View Alternative.md

Currently we already do everything with property explosion based on the following

Shell.TitleColor //applies to tab and flyout color
Shell.TabBarTitleColor //applies to tab and overrides TitleColor

So if we were to keep consistent here then we should just add the following Attached Properties

@PureWeen
PureWeen / FlyoutMenuTemplates.md
Created Nov 23, 2019
Flyout and MenuTemplates
View FlyoutMenuTemplates.md
<?xml version="1.0" encoding="UTF-8"?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:local="clr-namespace:ShellFlyouts.Views" Title="ShellFlyouts" x:Class="ShellFlyouts.AppShell"
    Shell.ItemTemplate="{StaticResource FlyoutTemplates}"
    Shell.MenuItemTemplate="{StaticResource FlyoutTemplates}"
      >
    <!-- 
        Styles and Resources 
    -->
    <Shell.Resources>
@PureWeen
PureWeen / Crashes.md
Created Aug 30, 2019
Android Crashes
View Crashes.md
08-30 08:09:55.562 3318-3318/? E/memtrack: Couldn't load memtrack module (No such file or directory)
08-30 08:09:55.562 3318-3318/? E/android.os.Debug: failed to load memtrack module: -2
08-30 08:09:56.865 4366-4413/com.android.launcher3 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb403d3e0
08-30 08:10:00.190 1264-1293/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
08-30 08:10:00.330 3327-3351/AndroidControlGallery.AndroidControlGallery E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-30 08:10:00.330 3327-3351/AndroidControlGallery.AndroidControlGallery E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-30 08:10:03.663 3327-3327/AndroidControlGallery.AndroidControlGallery E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-30 08:10:03.663 3327-3327/AndroidControlGallery.AndroidControlGallery E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-30 08:10:03.780 3327-3327/AndroidCo
View PickerIOS.md
[assembly:ExportRenderer(typeof(Picker), typeof(PlaceHolderPicker), new[] { typeof(VisualMarker.MaterialVisual), typeof(CustomMaterial) })]
namespace VisualPicker.iOS
{
    public class PlaceHolderPicker : MaterialPickerRenderer, IMaterialEntryRenderer
    {
        public PlaceHolderPicker()
        {
        }
View QuickMessage.md
public FormsView
{
  Func<Point, bool> _setInitialTransformationCallBack;
  
  // could hide this behind explicit interface
  public void RegisterCallBack(Func<Point, bool> callback)
  {
    _setInitialTransformationCallBack = callback;
  }
You can’t perform that action at this time.