private void ConnectToStreamSource() { ControlPanelViewModel viewModel = DataContext as ControlPanelViewModel; if (viewModel != null) { viewModel.ConnectToStreamSource(); } }
/// <summary> /// Creates the main window for the Wave Subscription Demo. /// </summary> public MainWindow() { InitializeComponent(); this.Loaded += MainWindow_Loaded; this.Closing += MainWindow_Closing; m_viewModel = new ControlPanelViewModel(this.WaveForm); this.ControlPanel.DataContext = m_viewModel; this.Stat.DataContext = new StatViewModel(m_viewModel.AudioGraph); m_viewModel.AudioGraph.PlaybackStateChanged += AudioGraph_PlaybackStateChanged; }