Beispiel #1
0
        /// <summary>
        /// Method invoked when the user clicks on Usa Windows Hello.
        /// Checks user's trustworthiness and enable Windows Hello.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            if (WindowsHelloCheckBox.IsChecked == true)
            {
                if (await UserConsentVerifier.RequestVerificationAsync(SecurityExtensions.MESSAGE) == UserConsentVerificationResult.Verified)
                {
                    WindowsHelloCheckBox.IsChecked = true;

                    SecurityExtensions.EnableWindowsHello();
                }
                else
                {
                    WindowsHelloCheckBox.IsChecked = false;

                    SecurityExtensions.DisableWindowsHello();
                }
            }
            else
            {
                SecurityExtensions.DisableWindowsHello();
            }
        }