Skip to content

Instantly share code, notes, and snippets.

View mecvillarina's full-sized avatar

Mark Erwin mecvillarina

View GitHub Profile
@mecvillarina
mecvillarina / maui.txt
Created January 16, 2023 01:57
MAUI Starter Helpers
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
const int WindowWidth = 540;
const int WindowHeight = 1000;
Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) =>
@mecvillarina
mecvillarina / xamarinandroidbindings.md
Created August 15, 2022 08:32 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@mecvillarina
mecvillarina / AndroidScrollBarColorEffect.cs
Last active April 21, 2022 20:57
Xamarin Forms ScrollView - Change ScrollBarColor using RoutingEffect
using UIEffects = ScrollView.UI.Effects;
[assembly: ResolutionGroupName(Constants.EffectsNamespace)]
[assembly: ExportEffect(typeof(ScrollBarColorEffect), nameof(ScrollBarColorEffect))]
namespace ScrollView.Droid.Effects
{
public class ScrollBarColorEffect : PlatformEffect
{
protected override void OnAttached()
@mecvillarina
mecvillarina / UIDirectionExtension
Created January 17, 2018 17:00 — forked from ads90/UIDirectionExtension
RTL Support for Xamarin Forms
/*
how to use it
you have to design your xaml to fit your need
EX:
<ColumnDefinition Width="{UIExtensions:UIDirection Type=GridLength,LTR=auto ,RTL=*}" />
HorizontalTextAlignment="{UIExtensions:UIDirection Type=TextAlignment,LTR=Start,RTL=End}"
HorizontalOptions="{UIExtensions:UIDirection Type=LayoutOption, LTR=Start, RTL=End}"
*/
using System;
@mecvillarina
mecvillarina / NoRippleListViewRenderer.cs
Created January 17, 2018 03:38 — forked from awatertrevi/NoRippleListViewRenderer.cs
Removes the material ripple effect on the Xamarin.Forms Android ListView.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
https://github.com/daniel-luberda/DLToolkit.Forms.Controls/tree/master/FlowListView
@mecvillarina
mecvillarina / project.csproj
Created December 29, 2017 08:05
.NET Standard 2
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
@mecvillarina
mecvillarina / Project.csproj
Last active December 30, 2017 14:36
Xamarin - Support references from PCL’s to NET Standard 1.0 to 1.6
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8</PackageTargetFallback>
<DebugType>Full</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="2.5.0.121934" />
public class BotRequest
{
public string @object { get; set; }
public List<BotEntry> entry { get; set; }
}
public class BotEntry
{
public string id { get; set; }
public long time { get; set; }
@mecvillarina
mecvillarina / ItemStack.cs
Created July 18, 2016 05:10 — forked from NVentimiglia/ItemStack.cs
Need a Items control or a repeater for Xamarin ? Here you go. Bind to observable collections, define your data template and enjoy.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Windows.Input;
using Xamarin.Forms;