Created
April 16, 2019 01:09
-
-
Save vitorpiovezam/a47fbfaf908c40bc01942c67c263f124 to your computer and use it in GitHub Desktop.
Xamarin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("Só", "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