Beispiel #1
0
        void CalibrationWindowDebugStuff()
        {
            PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Critical;

            Brush debugBrush = new SolidColorBrush(Colors.Blue);

            Button bonusButton = new Button
            {
                Content    = "BONUS!",
                Width      = 70,
                Height     = 20,
                Margin     = new Thickness(5),
                Foreground = debugBrush
            };

            Button pauseButton = new Button
            {
                Content    = "Pause",
                Width      = 70,
                Height     = 20,
                Margin     = new Thickness(5),
                Foreground = debugBrush
            };

            bonusButton.Click += BonusButton_Click;
            pauseButton.Click += PauseButton_Click;
            ButtonsStackpanel.Children.Add(bonusButton);
            ButtonsStackpanel.Children.Add(pauseButton);

            void BonusButton_Click(object sender, RoutedEventArgs e)
            {
                DebugStuff.MainWindowBonusAsync();
                DigitsListBox.ItemsSource = DebugStuff.CalibrateOcr();
            }

            void PauseButton_Click(object sender, RoutedEventArgs e)
            {
            }
        }
 void BonusButton_Click(object sender, RoutedEventArgs e)
 {
     DebugStuff.MainWindowBonusAsync();
 }