diff options
| author | Grant Limberg <grant.limberg@zerotier.com> | 2017-09-22 15:33:09 -0700 |
|---|---|---|
| committer | Grant Limberg <grant.limberg@zerotier.com> | 2017-09-22 15:33:09 -0700 |
| commit | c666f92e359061c0a4c133ba090832a059298782 (patch) | |
| tree | 43ab48c8673781f2437dbf326509b1f37e827c4e /windows/WinUI/OnboardProcess/LogIn.xaml.cs | |
| parent | eb42ef68eeb7a19a9b841cd9f3fe67ffb999c827 (diff) | |
| download | infinitytier-c666f92e359061c0a4c133ba090832a059298782.tar.gz infinitytier-c666f92e359061c0a4c133ba090832a059298782.zip | |
new startup process UI for Windows
Diffstat (limited to 'windows/WinUI/OnboardProcess/LogIn.xaml.cs')
| -rw-r--r-- | windows/WinUI/OnboardProcess/LogIn.xaml.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/windows/WinUI/OnboardProcess/LogIn.xaml.cs b/windows/WinUI/OnboardProcess/LogIn.xaml.cs new file mode 100644 index 00000000..8657b800 --- /dev/null +++ b/windows/WinUI/OnboardProcess/LogIn.xaml.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace WinUI.OnboardProcess +{ + /// <summary> + /// Interaction logic for LogIn.xaml + /// </summary> + public partial class LogIn : UserControl, ISwitchable + { + public LogIn() + { + InitializeComponent(); + } + + public void UtilizeState(object state) + { + throw new NotImplementedException(); + } + + public void LoginButton_Click(object sender, RoutedEventArgs e) + { + DoLogin(); + } + + public void BackButton_Click(object sender, RoutedEventArgs e) + { + Switcher.Switch(new RegisterOrLogIn()); + } + + private async void DoLogin() + { + CentralAPI api = CentralAPI.Instance; + bool didLogIn = await api.Login(EmailAddressTextBox.Text, PasswordTextBox.Password.ToString(), false); + if (didLogIn) + { + Switcher.Switch(new CreateOrJoin()); + } + else + { + ErrorText.Content = "Invalid username or password"; + } + } + } +} |
