Ejemplo n.º 1
0
        public AnalyticsOptInWindowViewModel(AnalyticsOptInWindow owner)
        {
            _owner = owner.ThrowIfNull(nameof(owner));

            OptInCommand = new ProtectedCommand(OnOptInCommand);
            AnalyticsLearnMoreLinkCommand = new ProtectedCommand(() => AnalyticsLearnMoreUtils.OpenLearnMoreLink());
        }
        /// <summary>
        /// Prompt user to share or not their usage info.
        /// </summary>
        /// <returns>
        /// true if the user opts in, the Yes button is cliked.
        /// false otherwise, the No button is cliked.
        /// </returns>
        public static bool PromptUser()
        {
            var dialog = new AnalyticsOptInWindow();

            dialog.ShowModal();
            return(dialog.ViewModel.Result);
        }