Skip to content

Instantly share code, notes, and snippets.

View kevinmutlow's full-sized avatar

Kevin Mutlow kevinmutlow

  • Brisbane, Australia
View GitHub Profile
@kevinmutlow
kevinmutlow / LoginPage.xaml
Last active August 2, 2024 00:53
Xamarin.Forms Login page sample
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App.Core.Pages.Account.LoginPage"
Title="{ Binding PageTitle }">
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,20,0,0" />
</OnPlatform>
@kevinmutlow
kevinmutlow / BasePageViewModel.cs
Created October 6, 2017 04:40
Xamarin.Forms base view model for pages
using System;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace App.Core.ViewModels
{
public class BasePageViewModel : INotifyPropertyChanged, IDisposable
{
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converters="clr-namespace:App.Core.Converters"
x:Class="App.Core.Pages.Account.RegisterPage"
Title="{ Binding PageTitle }">
<ContentPage.Resources>
<ResourceDictionary>
<converters:InverseBoolConverter x:Key="notConverter" />
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Xamarin.Forms;
namespace App.Core.Converters
{
public class InverseBoolConverter : IValueConverter
{
using System;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace App.Core.Models
{
public class BaseModel : INotifyPropertyChanged
{
@kevinmutlow
kevinmutlow / EmailListItemModel.cs
Created October 10, 2017 05:19
ListView with Email-style DataTemplate + ViewModel + Model
using System;
using System.Collections.Generic;
using System.Text;
namespace App.Core.Models
{
public class EmailListItemModel : BaseModel
{
private DateTime _dateReceived;
public DateTime DateReceived
@kevinmutlow
kevinmutlow / ExtSearchBar.xaml
Last active June 25, 2020 16:09
Custom SearchBar for Xamarin.Forms with Filter icon and auto-search on text changed
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App.Core.Controls.ExtSearchBar"
x:Name="Root">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
</Grid.RowDefinitions>
@kevinmutlow
kevinmutlow / TabBar.xaml
Created October 22, 2017 03:31
Custom/Cross-platform Tab-bar using Xamarin.Forms (for iOS and Android)
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App.Core.Controls.TabBar">
<Grid
x:Name="grdContainer"
RowSpacing="0"
ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@kevinmutlow
kevinmutlow / CornerRadiusEffect_Droid.cs
Created November 17, 2017 02:39
4 ways to create rounded Labels in Xamarin.Forms.
using App.Droid.Effects;
using App.Core.Effects;
using System;
using System.ComponentModel;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Android.Graphics.Drawables;
using Android.Util;
using Android.Content;