public void SelectSite(SiteViewModel siteModel) { if (BackgroundTask.Instance.IsExecuting) { return; } if (!siteModel.Site.Settings.DynamicCategoriesDiscovered) { BackgroundTask.Instance.Start <bool>( () => { siteModel.Site.DiscoverDynamicCategories(); return(true); }, (success, result) => { if (success) { SelectedSite = siteModel; ShowCategories(siteModel.Site.Settings.Categories, SelectedSite.Name); } }, Translation.Instance.GettingDynamicCategories); } else { SelectedSite = siteModel; ShowCategories(siteModel.Site.Settings.Categories, SelectedSite.Name); } }
public void SelectSite(SiteViewModel siteModel) { if (BackgroundTask.Instance.IsExecuting) return; if (!siteModel.Site.Settings.DynamicCategoriesDiscovered) { BackgroundTask.Instance.Start<bool>( () => { siteModel.Site.DiscoverDynamicCategories(); return true; }, (success, result) => { if (success) { SelectedSite = siteModel; ShowCategories(siteModel.Site.Settings.Categories, SelectedSite.Name); } }, Translation.Instance.GettingDynamicCategories); } else { SelectedSite = siteModel; ShowCategories(siteModel.Site.Settings.Categories, SelectedSite.Name); } }
public SiteSettingViewModel(SiteViewModel site, FieldPropertyDescriptorByRef propertyDescriptor) : base(Consts.KEY_NAME, propertyDescriptor.DisplayName) { Site = site; PropertyDescriptor = propertyDescriptor; _nameProperty = new WProperty(typeof(string), propertyDescriptor.DisplayName); _descriptionProperty = new WProperty(typeof(string), propertyDescriptor.Description); _isPasswordProperty = new WProperty(typeof(bool), propertyDescriptor.IsPassword); string valueAsString = site.Site.GetConfigValueAsString(propertyDescriptor); _valueProperty = new WProperty(typeof(string), propertyDescriptor.IsPassword ? new string('*', valueAsString.Length) : valueAsString); _newValueProperty = new WProperty(typeof(string), valueAsString); _possibleValuesProperty = new WProperty(typeof(ItemsList), null); Command = new MethodDelegateCommand(() => Configure()); }