Skip to content

Instantly share code, notes, and snippets.

<?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:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
x:Class="AppCliente.Views.Ofertas.OfertasExclusivas"
xmlns:local="clr-namespace:AppCliente.Converters;assembly=AppCliente"
xmlns:template="clr-namespace:AppCliente.Views.Ofertas;assembly=AppCliente"
Title="Assinantes"
BackgroundColor="#FFFFFF">
<ContentPage.Resources>
@brunoportess
brunoportess / IShare.cs
Created May 14, 2018 11:26
Implementação de SHARE no xamarin forms
//interface do projeto core
public interface IShare
{
Task Show(string title, string message, string filePath);
}
@brunoportess
brunoportess / Servico.cs
Last active February 16, 2018 13:03
BindingContext ViewModel Sample
namespace DocHouse.Models.Entities
{
public class Servico
{
public int Id { get; set; }
public string NomeServico { get; set; }
public string Imagem { get; set; }
public double Valor { get; set; }
}
}
@brunoportess
brunoportess / Chat.xaml
Created February 8, 2018 13:04
Base para criar chat com template similar ao whatsApp
<ScrollView>
<Grid RowSpacing="0" ColumnSpacing="0" >
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListView
x:Name="MessagesListView"
ItemTemplate="{StaticResource MessageTemplateSelector}"
<!--
Generated template for the AtendidasPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<button ion-button menuToggle showWhen="android">
<ion-icon name="menu"></ion-icon>
@brunoportess
brunoportess / AndroidManifest.xml
Created December 7, 2017 16:44
Xamarin Forms Maps - Android Settings
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="PACKAGE_NAME" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
@brunoportess
brunoportess / ISQLiteConf.cs
Created November 6, 2017 13:32
Exemplo implementação sqlite em xamarin forms. Foi usado o nuget package sqlite-net-pcl
using SQLite;
namespace NOME_SOLUCAO.SQLite
{
//PCL
public interface ISQLiteConf
{
SQLiteConnection GetConnection();
string DiretorioDB { get; }
@brunoportess
brunoportess / View.xaml
Created November 4, 2017 13:13
Meu switch tem o Toogle na propriedade EnviaOrcamento do meu objeto e essa propriedade é booleana (bool)
<?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:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
x:Class="Cliente.Views.Orcamento.OrcamentoEmpresas"
Title="Enviar para...">
<ListView
x:Name="ListCompanies"
CachingStrategy="RecycleElement"
ItemsSource="{Binding ListCompanies}"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cliente.Models.Entities
{
public class Orcamento
{
public class MaskMoney : Behavior<Entry>
{
protected override void OnAttachedTo(Entry bindable)
{
bindable.TextChanged += onTextChanged;
base.OnAttachedTo(bindable);
}
protected override void OnDetachingFrom(Entry bindable)