private void PlayList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (!isFirstTime && FacadeClass.soundIndex != PlayList.SelectedIndex) { string url = string.Concat(new List <string>() { FacadeClass.baseSoundURI, (SoundModel.GetEnumerable()).ElementAt(PlayList.SelectedIndex) }); GeneralObject.MainFacade.PlayStopSound(GeneralObject._backgroundPlayer, playingCommand.play, url); FacadeClass.soundIndex = PlayList.SelectedIndex; } isFirstTime = false; }
public SettingsForTwo() { InitializeComponent(); FirstClick(null, null); SecondClicked = false; Style.SelectedIndex = GeneralObject.style; PlayList.ItemsSource = SoundModel.GetEnumerable(); DataContext = GeneralObject._gameViewModel; Slider.Value = GeneralObject._backgroundPlayer.Volume * 100; PlayList.SelectedIndex = SoundModel.GetEnumerable() .ToList() .IndexOf(SoundModel.GetEnumerable().Where(s => GeneralObject._backgroundPlayer.Source.ToString().Contains(s)).First()); ClrPcker_Background.SelectedColorChanged += (sender, e) => { ClrPcker_Background_SelectedColorChanged(null, null); }; }