Exemple #1
0
        public Scanning()
        {
            InitializeComponent();

            ScanningWindows.ScanningManual scan = new ScanningWindows.ScanningManual();
            scan.btnManualScan.Click += BtnManualScan_Click;
            ContentArea.Content       = scan;

            _scanWorker = new BackgroundWorker();
            _scanWorker.WorkerSupportsCancellation = true;
            _scanWorker.WorkerReportsProgress      = true;
            _scanWorker.DoWork             += _scanWorker_DoWork;
            _scanWorker.RunWorkerCompleted += _scanWorker_RunWorkerCompleted;

            _saveWorker                     = new BackgroundWorker();
            _saveWorker.DoWork             += _saveWorker_DoWork;
            _saveWorker.RunWorkerCompleted += _saveWorker_RunWorkerCompleted;

            ReadyButton.Clicked  += ReadyButton_Clicked;
            CancelButton.Clicked += CancelButton_Clicked;
        }
Exemple #2
0
        private void btnScanMode_Click(object sender, RoutedEventArgs e)
        {
            Button send = (Button)sender;

            foreach (object modeButton in modeMenu.Children)
            {
                Button button = (Button)modeButton;
                if (button != send)
                {
                    button.Background = new SolidColorBrush(ColorScheme.MenuDarker);
                    button.Foreground = new SolidColorBrush(Colors.Black);
                    button.FontWeight = FontWeights.Normal;
                }
            }

            send.Background = new SolidColorBrush(ColorScheme.GlobalBlue);
            send.Foreground = new SolidColorBrush(Colors.White);
            send.FontWeight = FontWeights.Medium;

            switch (send.Name)
            {
            case "btnScanModeManual":
                _scanMode = ScanningMode.Manual;
                ScanningWindows.ScanningManual scanManual = new ScanningWindows.ScanningManual();
                scanManual.btnManualScan.Click += BtnManualScan_Click;
                ContentArea.Content             = scanManual;
                break;

            case "btnScanModeAutomatic":
                _scanMode = ScanningMode.Automatic;
                ScanningWindows.ScanningAutomatic scanAuto = new ScanningWindows.ScanningAutomatic();
                scanAuto.btnAutoScan.Click += BtnAutoScan_Click;
                ContentArea.Content         = scanAuto;
                break;
            }
        }