Skip to content

Instantly share code, notes, and snippets.

View angelobelchior's full-sized avatar
🏠
Working from home

Angelo Belchior angelobelchior

🏠
Working from home
View GitHub Profile
using System;
using System.Linq;
using Xamarin.Forms;
using System.Collections.Generic;
namespace MeuDB
{
public class AcessoDados : IDisposable
{
private SQLite.Net.SQLiteConnection _conexao;
sing System;
using SQLite.Net.Attributes;
namespace MeuDB
{
public class Contato
{
[PrimaryKey, AutoIncrement]
public int Id {
get;
using System;
using SQLite.Net.Interop;
namespace MeuDB
{
public interface IConfig
{
string DiretorioDB { get; }
ISQLitePlatform Plataforma { get; }
}
<?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="MeuDB.MyPage">
<ContentPage.Content>
<StackLayout Padding="30" Spacing="30">
<Entry x:Name="Nome" Placeholder="Nome"></Entry>
<Entry x:Name="Email" Placeholder="Email" Keyboard="Email"></Entry>
<Entry x:Name="Telefone" Placeholder="Telefone" Keyboard="Telephone"></Entry>
<Button x:Name="Salvar" Text="Salvar" Clicked="SalvarClicked"></Button>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace MeuDB
{
public partial class MyPage : ContentPage
{
public MyPage ()
<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyListViewCellApp.MainView">
<TabbedPage.Children>
<ContentPage Title="TextCell" Padding="0, 20, 0, 0">
<ContentPage.Content>
<StackLayout>
<ListView ItemsSource="{Binding Items}">
<ListView.ItemTemplate>
<DataTemplate>
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace MyListViewCellApp
{
public class ViewModel
{
public ObservableCollection<Item> Items {
get;
//Esse código é apenas para demonstração da funcionalidade do ChangeCanExecute
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void Notify(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
@angelobelchior
angelobelchior / gist:04d6a6b9162dd521b50cd58f5deba980
Created September 28, 2017 14:26
Update Forked Repository - Git
git remote add upstream https://github.com/andrebaltieri/FluentValidator.git
git fetch upstream
git checkout master
git rebase upstream/master
@angelobelchior
angelobelchior / BotActivityLogger.cs
Created December 18, 2017 16:54
Bot Activity Logger
public sealed class BotActivityLogger : Microsoft.Bot.Builder.History.IActivityLogger
{
public async Task LogAsync(IActivity activity)
{
var message = activity.AsMessageActivity();
var text = message.Text;
}
}
[BotAuthentication]