private void SetAssociatedLabel([NotNull] FrameworkElement element, [NotNull] string description) { Label label = element.Parent?.FindDescendant <Label>(); if (label == null) { return; } if (label.Content == null) { label.Content = description + ":"; _keywords.Add(new OptionsPageKeyword(description)); } else { string existingContentString = label.Content as string; if (existingContentString != null) { _keywords.Add(new OptionsPageKeyword(existingContentString)); } } SearchablePageBehavior.SetSearchFilter(label, true); }
private void ConfigureCheckBox([NotNull] CheckBoxDisabledNoCheck2 checkBox, [NotNull] string content, [NotNull] SettingsScalarEntry entry) { if (checkBox.Content == null) { checkBox.Content = content; } _keywords.Add(new OptionsPageKeyword(content)); _context.SetBinding <bool>(_lifetime, entry, checkBox, CheckBoxDisabledNoCheck2.IsCheckedLogicallyDependencyProperty); SearchablePageBehavior.SetSearchFilter(checkBox, true); }
private void SetAssociatedLabel([NotNull] FrameworkElement element, [NotNull] string description) { Label label = element.Parent?.FindDescendant <Label>(); if (label == null) { return; } switch (label.Content) { case null: label.Content = description + ":"; _keywords.Add(new OptionsPageKeyword(description)); break; case string existingContentString: _keywords.Add(new OptionsPageKeyword(existingContentString)); break; } SearchablePageBehavior.SetSearchFilter(label, true); }
private void SetCheckBoxBinding <TSettings>( [NotNull] Expression <Func <TSettings, bool> > settingAccessor, [NotNull] CheckBoxDisabledNoCheck2 checkBox, [CanBeNull] CheckBoxDisabledNoCheck2 parentCheckBox, bool addColonToDescription = false) { var entry = _context.Schema.GetScalarEntry(settingAccessor); if (checkBox.Content == null) { string description = entry.Description; _keywords.Add(new OptionsPageKeyword(description)); if (addColonToDescription) { description += ":"; } checkBox.Content = description; } _context.SetBinding <bool>(_lifetime, entry, checkBox, CheckBoxDisabledNoCheck2.IsCheckedLogicallyDependencyProperty); SearchablePageBehavior.SetSearchFilter(checkBox, true); parentCheckBox?.IsAppearingChecked.FlowInto(_lifetime, checkBox, IsEnabledProperty); }