public void Init(AppSettings settings, SongPlayer songPlayer, Playlist playlist, SpeechController speechControl) { ViewModel = new FullPlayerViewModel(settings, songPlayer, playlist, speechControl); CreateFullPlayer(!settings.StartMinimized); CreateSmallPlayer(settings.StartMinimized); SetupContextMenu(songPlayer); SetupScreenOverlay(settings, speechControl, songPlayer); }
public FullPlayer(FullPlayerViewModel fpvm) { InitializeComponent(); DataContext = fpvm; Action scrollIntoView = () => Application.Current.Dispatcher.BeginInvoke((Action)(() => ScrollCurrentSongIntoView())); fpvm.PropertyChanged += (s, p) => { if(p.PropertyName == nameof(FullPlayerViewModel.CurrentFocusItem)) { scrollIntoView(); } else if(p.PropertyName == nameof(FullPlayerViewModel.StatusText)) { UpdateStatusTextAnimation(); } }; fpvm.DisplayedSongsChanged += (s, a) => scrollIntoView(); SizeChanged += (s, a) => UpdateStatusTextAnimation(); }
public SongViewModel(Song song, FullPlayerViewModel fpvm) { curDisplay = DisplayType.Front; Song = song; MainViewModel = fpvm; }