コード例 #1
0
 private async void ToggleRegisterOrLoginButtonOnClicked(object sender, EventArgs e)
 {
     if (BindingContext is LoginViewModel viewModel)
     {
         if (viewModel.IsRegister)
         {
             await SignInButton.ColorTo(
                 (Color)Application.Current.Resources["LoginButtonBackground"],
                 (Color)Application.Current.Resources["RegisterButtonBackground"],
                 c => SignInButton.BackgroundColor = c,
                 100);
         }
         else
         {
             await SignInButton.ColorTo(
                 (Color)Application.Current.Resources["RegisterButtonBackground"],
                 (Color)Application.Current.Resources["LoginButtonBackground"],
                 c => SignInButton.BackgroundColor = c,
                 100);
         }
     }
 }