Ejemplo n.º 1
0
        /// <summary>
        /// This method is subscribed to the PropertyChanged event so we will be notified when the SearchState changed
        /// </summary>
        /// <param name="sender">PackageManagerSearchViewModel</param>
        /// <param name="e">PropertyChanged</param>
        private static void PackageManagerViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e, StepUIAutomation uiAutomationData)
        {
            PackageManagerSearchViewModel packageManagerViewModel = sender as PackageManagerSearchViewModel;

            if (packageManagerViewModel == null)
            {
                return;
            }
            if (e.PropertyName == nameof(packageManagerViewModel.SearchState))
            {
                //Let wait until the initial Package Search is completed and we got results then we will search the Autodesk Sample package
                if (packageManagerViewModel.SearchState == PackageSearchState.Results)
                {
                    //Put the name of the Package to be searched in the SearchTextBox
                    packageManagerViewModel.SearchText = AutodeskSamplePackage;

                    searchPackagesLoaded = true;

                    EnableNextButton(null, uiAutomationData, true, GuideFlow.FORWARD);
                    packageManagerViewModel.DisableSearchTextBox();

                    //Unsubscribe from the PropertyChanged event otherwise it will enter everytime the SearchTextBox is updated
                    packageManagerViewModel.PropertyChanged -= searchPackagesPropertyChanged.Invoke;
                }
            }
        }