Esempio n. 1
0
        private void showScanPage(object sender, RoutedEventArgs e)
        {
            //List models in descending order for uniformity
            NVIDIAWanted = NVIDIAWanted.OrderByDescending(x => x).ToList();
            AMDWanted    = AMDWanted.OrderByDescending(x => x).ToList();

            // Testing module.
            // Query will include pages where the items are always in stock.
            bool testing = true;

            if (testing)
            {
                NVIDIAWanted.Add("Test1");
                NVIDIAWanted.Add("Test2");
            }


            // If selection is valid, then transition into ScanPage
            if (isSelectionValid())
            {
                ScanPage sp = new ScanPage(NVIDIAWanted, AMDWanted);
                sp.AsyncInitUIM();
                this.NavigationService.Navigate(sp);

                Task.Delay(3000);
                Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => sp.start())).Wait();
            }
            // Selection is not valid (selection is null - no items chosen)
            // Error message should be displayed
            else
            {
                DisplayErrorMessage();
            }
        }