Skip to content

Instantly share code, notes, and snippets.

View hamid-shaikh's full-sized avatar
😅
I may be slow to respond.

Hamid Shaikh hamid-shaikh

😅
I may be slow to respond.
  • Cognizant Technology Solutions
  • Mumbai, India
View GitHub Profile
@hamid-shaikh
hamid-shaikh / AppAttachProperties.cs
Last active July 2, 2019 06:07
Xamarin.Forms Attach Properties (TapCommand, TapCommandParameter, AnimateView, AnimateOnTap) - Easily attach any of these properties to Xamarin.Forms controls
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
//TapCommandProperty
public static class AppAttachProperties
{
public static readonly BindableProperty TapCommandProperty =
BindableProperty.CreateAttached(
"TapCommand",
@hamid-shaikh
hamid-shaikh / TestPage.xaml
Created June 18, 2019 06:25
AppAttachProperties usage example
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:appHelpers="clr-namespace:ProjectName.Mobile.Helpers"
x:Class="ProjectName.Mobile.Views.TestPage">
<!--ContentPage Content-->
<Grid
BackgroundColor="{StaticResource whiteColor}"
RowSpacing="0"
ColumnSpacing="0">
@hamid-shaikh
hamid-shaikh / TapToCommandBehavior.cs
Last active June 24, 2019 11:03
Xamarin.Forms Attach TapToCommandBehavior to any control and make it Tappable with Animation
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
public class TapToCommandBehavior : Behavior
{
private readonly TapGestureRecognizer tapGestureRecognizer;
private View AttachedToView;