示例#1
0
        private static void OnVolumeChanged(IVolumeSettingsView volumeSettingsView, int volume)
        {
            volumeSettingsView.OnVolumeChanged(volume);

            var color = volume > 5 ? Color.red : Color.black;

            volumeSettingsView.SetVolumeColoring(color);
        }
示例#2
0
        public VolumeSettingsPresenter(IVolumeSettingsView volumeSettingsView, IVolumeModel volumeModel)
        {
            volumeSettingsView.OnIncreaseVolumeButtonClicked += () => { IncreaseVolume(volumeModel); };

            volumeSettingsView.OnDecreaseVolumeButtonClicked += () => { DecreaseVolume(volumeModel); };

            volumeModel.OnVolumeChanged += volume => { OnVolumeChanged(volumeSettingsView, volume); };
        }