Skip to content

Instantly share code, notes, and snippets.

View xamarinskills's full-sized avatar

Sumit Sisodia xamarinskills

View GitHub Profile
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="SecureDesignApp.Views.ProfilePage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:awsomefonts="clr-namespace:SecureDesignApp.Fonts"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="ProfilePageView"
@xamarinskills
xamarinskills / CurvedCornersButtonRenderer
Last active December 13, 2017 05:23
Custom button in Ios Project
[assembly: ExportRenderer(typeof(CustomButton), typeof(CurvedCornersButtonRenderer))]
namespace MyNewApp.iOS.CustomRenderer
{
public class CurvedCornersButtonRenderer: ButtonRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
{
base.OnElementChanged(e);
var view = (CustomButton)Element;
@xamarinskills
xamarinskills / CurvedCornersButtonRenderer.cs
Last active December 13, 2017 05:22
CustomButton In Andorid Project
[assembly: ExportRenderer(typeof(CustomButton), typeof(CurvedCornersButtonRenderer))]
namespace MyNewApp.Droid.CustomRenderer
{
public class CurvedCornersButtonRenderer: ButtonRenderer
{
private GradientDrawable _gradientBackground;
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
{
base.OnElementChanged(e);
var view = (CustomButton)Element;
@xamarinskills
xamarinskills / MainPage.xaml.cs
Last active December 13, 2017 05:21
Renderering Button in XAML
<ContentPage.Content>
<StackLayout VerticalOptions="StartAndExpand" Padding="20,5" Spacing="10">
<customview:CustomButton x:Name="btnSignin"
CustomBorderColor="#24C4FF"
CustomBackgroundColor="#24C4FF"
Text="Log In" TextColor="White"
Clicked="btnSignin_Clicked"
CustomBorderRadius="4"
CustomBorderWidth="4"
VerticalOptions="Center"/>
@xamarinskills
xamarinskills / CustomButton.cs
Last active December 13, 2017 05:21
Renderering Button
public class CustomButton: Button
{
public static readonly BindableProperty CustomBorderColorProperty =
BindableProperty.Create(nameof(CustomBorderColor),
typeof(Color),typeof(CustomButton),
Color.Default);
public Color CustomBorderColor
{
get { return (Color)GetValue(CustomBorderColorProperty); }
<local:UnderLineLabel Text="Forget Password" TextColor="Brown" LineColor="Orange" HorizontalOptions="EndAndExpand"/>
public partial class UnderLineLabel : ContentView
{
public UnderLineLabel ()
{
InitializeComponent ();
}
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
<ContentView.Content>
<StackLayout Grid.Row="0" Padding="0" VerticalOptions="Center">
<Label x:Name="customLabel" Text="{Binding Text, Mode=TwoWay}" TextColor="{Binding TextColor,Mode=TwoWay}"/>
<BoxView x:Name="customBox"
BackgroundColor="{Binding LineColor,Mode=TwoWay}"
HeightRequest="1"
Margin="0,-8,0,0" />
</StackLayout>
</ContentView.Content>
<StackLayout Padding="10">
<controls:ImageEntry Text="Left Image" Placeholder="Xamarin Skills" AccentColor="Red"
ImageAlignment="Left" LImageSource="email"/>
<controls:ImageEntry Text="Right Image" Placeholder="Xamarin Skills"
AccentColor="Green" ImageAlignment="Right" RImageSource="user"/>
<controls:ImageEntry Text="Both Side Image" AccentColor="Yellow" LImageSource="email"
RImageSource="eyeshow" ImageAlignment="Password" />
<controls:ImageEntry Placeholder="Xamarin Skills" Text="None Image" AccentColor="Black" LImageSource="email"
RImageSource="eyeshow" ImageAlignment="None" />
<controls:ImageEntry Placeholder="Xamarin Skills" Text="Left Image Entry Clicked" AccentColor="White"
public partial class ImageEntry : ContentView
{
public static BindableProperty TextProperty =
BindableProperty.Create(nameof(Text),typeof(string),
typeof(ImageEntry),defaultBindingMode: BindingMode.TwoWay);
public static BindableProperty PlaceholderProperty =
BindableProperty.Create(nameof(Placeholder),
typeof(string), typeof(ImageEntry),
defaultBindingMode: BindingMode.TwoWay,
propertyChanged: (bindable, oldVal, newval) =>