Skip to content

Instantly share code, notes, and snippets.

View rdelrosario's full-sized avatar

Rendy Del Rosario rdelrosario

View GitHub Profile
@rdelrosario
rdelrosario / MainPage.xaml
Created May 8, 2018 13:14
ExtendedEditorControl Forms Page
<?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:controls="clr-namespace:ExtendedEditorSample.Controls"
x:Class="ExtendedEditorSample.MainPage"
BackgroundColor="LightGray">
<ContentPage.Content>
<StackLayout Padding="40">
<controls:ExtendedEditorControl HasRoundedCorner="true"
IsExpandable="true"
@rdelrosario
rdelrosario / CustomLabelRenderer.cs
Created May 20, 2018 22:36
Android CustomLabel Renderer
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Text;
@rdelrosario
rdelrosario / CustomLabelRenderer.cs
Created May 20, 2018 22:38
CustomKerningSample iOS
using CustomKerningSample.Controls;
using CustomKerningSample.iOS.Renderers;
using Foundation;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
<?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:local="clr-namespace:CustomKerningSample"
xmlns:controls="clr-namespace:CustomKerningSample.Controls"
x:Class="CustomKerningSample.MainPage">
<StackLayout VerticalOptions="CenterAndExpand"
HorizontalOptions="FillAndExpand"
Padding="20">
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ChatUIXForms.Views.Cells.IncomingViewCell">
<Frame BackgroundColor="LightBlue"
Padding="10"
HasShadow="false"
Margin="10,10,80,10">
<Label Text="{Binding Text}"/>
</Frame>
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ChatUIXForms.Views.Cells.OutgoingViewCell">
<Frame BackgroundColor="Gray"
Padding="10"
HasShadow="false"
Margin="80,10,10,10">
<Label Text="{Binding Text}"
TextColor="White"/>
using System;
namespace ChatUIXForms.Models
{
public class Message
{
public string Text { get; set; }
public string User { get; set; }
}
}
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Input;
using ChatUIXForms.Models;
using Xamarin.Forms;
namespace ChatUIXForms.ViewModels
{
public class ChatPageViewModel: INotifyPropertyChanged
using ChatUIXForms.Models;
using ChatUIXForms.Views.Cells;
using Xamarin.Forms;
namespace ChatUIXForms.Helpers
{
class ChatTemplateSelector : DataTemplateSelector
{
DataTemplate incomingDataTemplate;
DataTemplate outgoingDataTemplate;
<?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="ChatUIXForms.Views.ChatPage"
xmlns:local="clr-namespace:ChatUIXForms.Helpers"
xmlns:partials="clr-namespace:ChatUIXForms.Views.Partials">
<ContentPage.Resources>
<ResourceDictionary>
<local:ChatTemplateSelector x:Key="MessageTemplateSelector"/>
</ResourceDictionary>