public SettingsViewModel(IUnityContainer container,
                                 CoreDispatcher dispatcher,
                                 IForegroundUpdateService foregroundUpdateService)
        {
            _foregroundUpdateService = foregroundUpdateService;
            _localSettings           = ApplicationData.Current.LocalSettings;
            _dispatcher = dispatcher;

            _mediaSettings = container.Resolve <IMediaSettingsChannel>();
            _callChannel   = container.Resolve <ICallChannel>();
            _ntpService    = container.Resolve <NtpService>();

            _ntpService.OnNtpSyncFailed    += HandleNtpSynFailed;
            _ntpService.OnNtpTimeAvailable += HandleNtpTimeSync;

            CloseCommand           = new DelegateCommand(OnCloseCommandExecute);
            SaveCommand            = new DelegateCommand(OnSaveCommandExecute);
            QuitAppCommand         = new DelegateCommand(OnQuitAppCommandExecute);
            DeleteIceServerCommand = new DelegateCommand <IceServerViewModel>(OnDeleteIceServerCommandExecute);
            AddIceServerCommand    = new DelegateCommand(OnAddIceServerCommandExecute);

            // When AudioRoutingManager API is available, the UI elements related to microphone and speaker selection
            // are hidden from settings view.
            // In this case, the user will have the option to change the devices to be used from the call UI.
            // https://msdn.microsoft.com/en-us/library/windows/apps/windows.phone.media.devices.audioroutingmanager.aspx
            EnableAudioDeviceSelection = !ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract", 1);

            _foregroundUpdateService.OnMediaDevicesChanged += OnMediaDevicesChanged;
        }
        public SettingsViewModel(IUnityContainer container,
                                 CoreDispatcher dispatcher)
        {
            _localSettings = ApplicationData.Current.LocalSettings;
            _dispatcher    = dispatcher;

            _mediaSettings = container.Resolve <IMediaSettingsChannel>();
            _voipChannel   = container.Resolve <IVoipChannel>();
            _ntpService    = container.Resolve <NtpService>();

            _ntpService.OnNTPSyncFailed    += handleNtpSynFailed;
            _ntpService.OnNTPTimeAvailable += handleNtpTimeSync;

            CloseCommand           = new DelegateCommand(OnCloseCommandExecute);
            SaveCommand            = new DelegateCommand(OnSaveCommandExecute);
            QuitAppCommand         = new DelegateCommand(OnQuitAppCommandExecute);
            DeleteIceServerCommand = new DelegateCommand <IceServerViewModel>(OnDeleteIceServerCommandExecute);
            AddIceServerCommand    = new DelegateCommand(OnAddIceServerCommandExecute);
        }