Skip to content

Instantly share code, notes, and snippets.

@vitorpiovezam
Created April 16, 2019 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorpiovezam/a47fbfaf908c40bc01942c67c263f124 to your computer and use it in GitHub Desktop.
Save vitorpiovezam/a47fbfaf908c40bc01942c67c263f124 to your computer and use it in GitHub Desktop.
Xamarin
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using Xamarin.Forms;
namespace FiapCoin.ViewModel
{
public class LoginViewModel : INotifyPropertyChanged
{
public ICommand BotaoEntrarCommand { get; set; }
public ICommand BotaoSairCommand { get; set; }
private void executedMethod()
{
App.Current.MainPage.DisplayAlert("", "Salve", "pra geral");
MessagingCenter.Send<String>("", "LoginSucesso");
}
public LoginViewModel()
{
BotaoEntrarCommand = new Command(()=>
{
App.Current.MainPage.DisplayAlert("Fabrica de bico", "arsenal de fuzil", "novo");
MessagingCenter.Send<String>("", "LoginSucesso");
});
BotaoSairCommand = new Command(() =>
{
App.Current.MainPage.DisplayAlert("Quero do boldo", "entre rajadas e pipocos", "manda buscar");
MessagingCenter.Send<String>("", "Sair");
});
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private string usuario;
public string Usuario
{
get { return usuario; }
set
{
if (usuario != value)
{
usuario = value;
NotifyPropertyChanged();
}
}
}
private string senha;
public string Senha
{
get
{
return senha;
}
set
{
if (senha != value)
{
senha = value;
NotifyPropertyChanged();
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment