public ContactViewModel(IActionHelper actionHelper, IContactLogic contactLogic, ISettingLogic settingLogic, IMvxNavigationService navigationService) { _contactLogic = contactLogic; _navigationService = navigationService; _settingLogic = settingLogic; _actionHelper = actionHelper; SaveContactCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(SaveContact)); NumberPrefixes = NumberPrefixProvider.GetNumberPrefixes(); }
public SettingsViewModel(ISettingLogic settingLogic, IActionHelper actionHelper, IMvxNavigationService navigationService, IMvxMessenger messenger) { _settingLogic = settingLogic; _actionHelper = actionHelper; _navigationService = navigationService; _messenger = messenger; LoadSettingsCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(LoadSettings)); SaveSettingsCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(SaveSettings)); NumberPrefixes = NumberPrefixProvider.GetNumberPrefixes(); }
public BarrierViewModel(IBarrierLogic barrierLogic, ISettingLogic settingLogic, IActionHelper actionHelper, IMvxNavigationService navigationService, IMvxMessenger messenger) { _barrierLogic = barrierLogic; _settingLogic = settingLogic; _actionHelper = actionHelper; _navigationService = navigationService; _messenger = messenger; SaveBarrierCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(SaveBarrier)); LoadBarrierCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(LoadBarrier)); NumberPrefixes = NumberPrefixProvider.GetNumberPrefixes(); }
public async Task <SettingsModel> GetSettingsAsync() { var settingsModel = new SettingsModel(); var defaultNumberPrefixSetting = await _settingRepository.GetByKeyAsync(DataConstants.SettingDefaultNumberPrefixKey); if (defaultNumberPrefixSetting == null) { settingsModel.NumberPrefix = NumberPrefixProvider.GetNumberPrefixes().FirstOrDefault(); } else { settingsModel.NumberPrefix = NumberPrefixProvider.GetById(int.Parse(defaultNumberPrefixSetting.Value)); } return(settingsModel); }