示例#1
0
        public void LinkSounds(Sounds sounds)
        {
            var tempSounds = new ItemsChangeObservableCollection <SoundConfig>();

            var soundsList = sounds.List;

            for (int i = 0; i < soundsList.Count; i++)
            {
                var sound = soundsList[i];

                var soundConfig = new SoundConfig(sound)
                {
                    ID = i
                };
                tempSounds.Add(soundConfig);
            }

            Sounds = tempSounds;
            this.NotifyPropertyChanged(nameof(Sounds));
        }
示例#2
0
        public SoundsViewModel()
        {
            var tempSounds = new ItemsChangeObservableCollection <SoundConfig>();

            for (int i = 0; i < 5; i++)
            {
                var sound = new Sound()
                {
                    FilePath = "C:/dummy.wav", Volume = 0.2
                };
                var soundConfig = new SoundConfig(sound)
                {
                    ID = i
                };

                tempSounds.Add(soundConfig);
            }

            Sounds = tempSounds;
        }