Esempio n. 1
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            BoothViewModel viewModel = this.DataContext as BoothViewModel;

            if (viewModel != null)
            {
                if (!viewModel.ClosePermanently)
                {
                    e.Cancel = true;
                    viewModel.CloseBoothWindow();
                }
            }
        }
Esempio n. 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = sender as Button;

            if (b != null)
            {
                BoothViewModel vm = b.DataContext as BoothViewModel;

                if (vm != null)
                {
                    vm.ShowBoothWindow();
                }
            }
        }
Esempio n. 3
0
        private void StartButtonClick(object sender, RoutedEventArgs e)
        {
            //Start or stop collecting data
            BoothViewModel viewModel = this.DataContext as BoothViewModel;

            viewModel.IsRunning = !viewModel.IsRunning;

            if (viewModel.IsRunning)
            {
                viewModel.Run();
            }
            else
            {
                viewModel.Stop();
            }
        }
Esempio n. 4
0
        public MainWindow()
        {
            InitializeComponent();

            //Get an instance of the scope manager.  This should also create the first instance,
            //which should also configure all of the oscilloscopes.
            var scopeManager = ScopeManager.GetInstance();

            //Start streaming on all scopes
            foreach (PicoScope s in scopeManager.Scopes)
            {
                //Create a view model for the booth/scope
                BoothViewModel vm = new BoothViewModel(s);

                //Add the booth/scope to the items control of this window
                BoothList.Items.Add(vm);
            }
        }