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
<ImageButton Source="{FontImage FontFamily={StaticResource MyFontFamily},
Glyph={StaticResource SmileFace},
Color={StaticResource White}" />
<ImageButton>
<ImageButton.Source>
<FontImageSource
FontFamily="{StaticResource MyFontFamily}"
Glyph="{StaticResource SmileFace}"
Color="{StaticResource PrimaryColor}" />
</Image.Source>
</ImageButton>
@angelobelchior
angelobelchior / welcome-message-bot-framework.cs
Created April 27, 2018 14:10
Welcome Message Bot Framework
private async Task ShowWelcomeMessage(Activity activity)
{
if (activity is IConversationUpdateActivity conversationUpdated)
{
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
foreach (var member in conversationUpdated.MembersAdded ?? Array.Empty<ChannelAccount>())
{
if (member.Id == conversationUpdated.Recipient.Id)
{
var reply = Actions.WelcomeMessage(activity);
@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]
@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
//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));
}
}
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace MyListViewCellApp
{
public class ViewModel
{
public ObservableCollection<Item> Items {
get;
<?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.Generic;
using Xamarin.Forms;
namespace MeuDB
{
public partial class MyPage : ContentPage
{
public MyPage ()
<?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>