public FingerprintService(IObservable <Unit> applicationActivated, FuncAsync <string> description, IScheduler dispatcher, IScheduler backgroundScheduler, bool fallbackOnPasscodeAuthentication = false)
        {
            applicationActivated.Validation().NotNull(nameof(applicationActivated));
            description.Validation().NotNull(nameof(description));
            dispatcher.Validation().NotNull(nameof(dispatcher));
            backgroundScheduler.Validation().NotNull(nameof(backgroundScheduler));

            _description = description;

            _dispatcher = dispatcher;

            _asyncLock = new AsyncLock();

            _isSupported =
                applicationActivated
                .ObserveOn(backgroundScheduler)
                .StartWith(backgroundScheduler, Unit.Default)
                .Select(_ => CheckSupport())
                .Replay(1, backgroundScheduler)
                .RefCount();

            _isEnabled =
                _isSupported
                .Select(isSupported => isSupported && CheckEnrollment())
                .Replay(1, backgroundScheduler)
                .RefCount();

            _fallbackOnPasscodeAuthentication = fallbackOnPasscodeAuthentication;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="BiometryService" /> class.
        /// </summary>
        /// <param name="supported">A bool to know if the device is supported.</param>
        /// <param name="enrolled">A bool to know if the device is enrolled.</param>
        /// <param name="backgroundScheduler">The <see cref="IScheduler" /> to use.</param>
        public BiometryService(bool supported, bool enrolled, IScheduler backgroundScheduler)
        {
            backgroundScheduler.Validation().NotNull(nameof(backgroundScheduler));

            _keys = ApplicationData.Current.LocalSettings.Values;

            _asyncLock = new AsyncLock();

            _isSupported =
                Observable.Never <bool>()
                .StartWith(supported)
                .Replay(1, backgroundScheduler)
                .RefCount();

            _isEnabled =
                _isSupported
                .Select(isSupported => isSupported && enrolled)
                .Replay(1, backgroundScheduler)
                .RefCount();
        }