public MediaPlayerView(MediaPlayerViewModel viewmodel)
 {
     vm = viewmodel;
     InitializeComponent();
     vm = viewmodel;
     vm.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) {
         NotifyPropertyChanged(e.PropertyName);
     };
     DataContext        = vm;
     timeSlider.Maximum = (int)vm.numOfRows;
 }
Exemple #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (mediaPlayer.IsChecked == true)
            {
                var modelmedia       = new MediaPlayerModel(CSVArray);
                var vmmediaControl   = new MediaPlayerViewModel(modelmedia);
                var mediaControlForm = new MediaPlayerView(vmmediaControl);
                modelmedia.PropertyChanged += delegate(Object s, PropertyChangedEventArgs entry) {
                    NotifyPropertyChanged(s, "MP_" + entry.PropertyName);
                };
                models.Add(modelmedia);
                mediaControlForm.Show();
                //vmmediaControl.startModel();
            }
            if (graphs.IsChecked == true)
            {
                var grapgmodel = new GraphsModel(CSVArray, XMLPath, this);
                models.Add(grapgmodel);
                var graphForm = new Graphs(new GraphsViewModel(grapgmodel));
                graphForm.Show();
            }
            if (navigatorControls.IsChecked == true)
            {
                var modelnavigatorControl = new WheelModel(CSVArray, XMLPath, this);
                var vmnavigatorControl    = new WheelViewModel(modelnavigatorControl);
                var navigatorControlForm  = new wheel(vmnavigatorControl);

                models.Add(modelnavigatorControl);
                navigatorControlForm.Show();
            }
            if (AnomaliesDetecting.IsChecked == true && dllPathChanged && regPathChanged)
            {
                PopupDetectionModel     pdmodel = new PopupDetectionModel(CSVArray, XMLPath, this, DLLpath, Reg_Flightpath, CSVPath);
                PopupDetectionViewModel vmpop   = new PopupDetectionViewModel(pdmodel);
                models.Add(pdmodel);
                PopupDetection pview = new PopupDetection(vmpop);
                pview.Show();
            }


            this.Close();
            foreach (var model in models)
            {
                model.connect();
            }
            foreach (var model in models)
            {
                model.start();
            }
        }