public MainWindow() { InitializeComponent(); fm = new MyFlightModel(); vm = new ViewModel(fm); this.plot.DataContext = vm; vm_FD = new VM_FileDialog(fm); this.FilesDialog.vm = vm_FD; this.FilesDialog.DataContext = vm_FD; vm_A = new VM_Attributes(fm); this.Attributes.vm = vm_A; this.Attributes.DataContext = vm_A; vm_ANR = new VM_AnomalyReport(fm); this.AnomalyReportList.vm = vm_ANR; this.AnomalyReportList.DataContext = vm_ANR; this.anomalyDLL.vm = vm_ANR; this.anomalyDLL.DataContext = vm_ANR; this.AnomalyReportList.vm = vm_ANR; this.AnomalyReportList.DataContext = vm_ANR; vm_P = new VM_Plot(fm); this.plot.vm = vm_P; this.plot.DataContext = vm_P; this.plot.vm.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { if (e.PropertyName.Equals("VM_Investigated_Annotation")) { //this.Attributes.listbox.ItemsSource; /*Thread t = new Thread(this.plot.listeningFunc); * t.SetApartmentState(ApartmentState.STA); * t.Start();*/ //((DispatcherTimer)sender).this.plot.listeningFunc(); this.plot.listeningFunc(); } }; this.DataContext = vm; vm_A.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { if (e.PropertyName.Equals("VM_XmlNameList")) { //this.Attributes.listbox.ItemsSource; this.Attributes.addEventHendler2Attributes(); } }; }
public VM2(MyFlightModel m) { fm = m; }