/// <summary> /// Loads new state of ViewModel /// </summary> private void InitialiazeDataContext() { this._viewModel = new ProjectEditorContext(App.DbConnectionString); this._viewModel.LoadData((int)IsoSettingsManager.LoadRecord("CurrentProjectId")); this.DataContext = this._viewModel; _playerManager = new PlayerManager(_viewModel.CurrentProject.Tempo); _playerManager.StateChangedEvent += _playerManager_StateChangeEvent; }
/// <summary> /// Loads new state of ViewModel /// </summary> private void InitialiazeDataContext() { this._viewModel = new SampleEditorContext(App.DbConnectionString); this._viewModel.LoadData((int)IsoSettingsManager.LoadRecord("CurrentSampleId")); this.DataContext = this._viewModel; this.PianoRoll.ItemsSource = this._viewModel.Tacts; _playerManager = new PlayerManager(_viewModel.CurrentSample.TrackRef.ProjectRef.Tempo); _playerManager.StateChangedEvent += _playerManager_StateChangeEvent; }
/// <summary> /// Loads new state of ViewModel /// </summary> private void InitialiazeDataContext() { this._viewModel = new TrackEditorContext(App.DbConnectionString); this._viewModel.LoadData((int)IsoSettingsManager.LoadRecord("CurrentTrackId")); this.DataContext = this._viewModel; this._viewModel.CurrentTrack.Samples.CollectionChanged += Samples_CollectionChanged; _playerManager = new PlayerManager(_viewModel.CurrentTrack.ProjectRef.Tempo); _playerManager.StateChangedEvent += PlayerManager_OnStateChangeEvent; _playerManager.TactChangedEvent += PlayerManager_OnTactChangedEvent; }