Ejemplo n.º 1
0
        public TLPhotoPickerSettings GetPhotoPickerSettings()
        {
            if (_photoPickerSettings != null)
            {
                return(_photoPickerSettings);
            }

            _photoPickerSettings = TLUtils.OpenObjectFromMTProtoFile <TLPhotoPickerSettings>(_photoPickerSettingsSyncRoot, Constants.PhotoPickerSettingsFileName)
                                   ?? new TLPhotoPickerSettings {
                External = false
            };

            return(_photoPickerSettings);
        }
Ejemplo n.º 2
0
        public PhotoPickerViewModel(ICacheService cacheService, ICommonErrorHandler errorHandler, IStateService stateService, INavigationService navigationService, IMTProtoService mtProtoService, ITelegramEventAggregator eventAggregator)
            : base(cacheService, errorHandler, stateService, navigationService, mtProtoService, eventAggregator)
        {
            _settings = StateService.GetPhotoPickerSettings();

            MainRules = new List <TLPrivacyRuleBase>
            {
                new TLPrivacyValueAllowAll {
                    Label = AppResources.InAppPhotoPicker
                },
                new TLPrivacyValueAllowContacts {
                    Label = AppResources.ExternalPhotoPicker
                }
            };

            _selectedMainRule           = _settings.External ? MainRules[1] : MainRules[0];
            _selectedMainRule.IsChecked = true;

            PropertyChanged += OnPropertyChanged;
        }
Ejemplo n.º 3
0
        public void SavePhotoPickerSettings(TLPhotoPickerSettings photoPickerSettings)
        {
            _photoPickerSettings = photoPickerSettings;

            TLUtils.SaveObjectToMTProtoFile(_photoPickerSettingsSyncRoot, Constants.PhotoPickerSettingsFileName, photoPickerSettings);
        }