Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Works on My Device 📱

Thiago Bertuzzi TBertuzzi

👨‍💻
Works on My Device 📱
View GitHub Profile
View MainViewModel.cs
using System;
using System.Windows.Input;
using FluentValidation;
using MvvmHelpers;
using Xamarin.Forms;
using XamarinFluentValidation.Models;
using XamarinFluentValidation.Models.Validators;
namespace XamarinFluentValidation.ViewModels
{
View PessoaValidator.cs
using System;
using FluentValidation;
namespace XamarinFluentValidation.Models.Validators
{
public class PessoaValidator : AbstractValidator<Pessoa>
{
public PessoaValidator()
{
RuleFor(x => x.Nome).NotEmpty().WithMessage("Nome Obrigatório").
@TBertuzzi
TBertuzzi / MainPage.xaml
Last active Nov 10, 2020
FluentValidation
View MainPage.xaml
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Padding="0,60,0,0"
x:Class="XamarinFluentValidation.MainPage">
<StackLayout>
<Label Text="Dados Pessoais" Margin="0,20,0,0" > </Label>
@TBertuzzi
TBertuzzi / Pessoa.cs
Created Nov 3, 2020
FluenteValidation
View Pessoa.cs
using System;
using MvvmHelpers;
namespace XamarinFluentValidation.Models
{
public class Pessoa : ObservableObject
{
private string _nome;
public string Nome
{
View MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace XamarinShareExemplo
View MainPage.xaml
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" Padding="0,60,0,0" x:Class="XamarinShareExemplo.MainPage">
<StackLayout>
<Label Text="Copartilhar Informações" FontAttributes="Bold" FontSize="Large"
HorizontalTextAlignment="Center" ></Label>
<Entry x:Name="entryTexto" Placeholder="Digite um Texto para Compartilhar" ></Entry>
<Button x:Name="btnShareText" Text="Compartilhar texto" Clicked="btnShareText_Clicked"/>
<Entry x:Name="entryUrl" Placeholder="Digite uma url para compartilhar" ></Entry>
<Button x:Name="btnShareUrl" Text="Compartilhar URL" Clicked="btnShareUrl_Clicked"/>
View MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Plugin.BreachDetector;
namespace XamarinFormsBreachDetector
View info.plist
<key>NSFaceIDUsageDescription</key>
<string>Use a nice explanation here</string>
View info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>cydia</string>
<string>undecimus</string>
<string>sileo</string>
<string>zbra</string>
</array>
View HttpExtension.cs
public async Task<List<Pokemon>> GetPokemonsAsync()
{
List<Pokemon> pokemons = new List<Pokemon>();
try
{
var httpClient = new HttpClient();
for (int i = 1; i < 20; i++)
{
You can’t perform that action at this time.