Skip to content

ControlExtensions class

Fluent API extension methods for controls.

Guide: C# Markup guide

public static class ControlExtensions
name description
static AccessKeyTarget(…) Sets Target, the element that receives the access key activation.
static Add(…) Adds an entry built beforehand, such as a checkable MenuItem, after the existing items.
static AutoHorizontalScroll(…) Sets HorizontalScroll to Auto.
static AutoVerticalScroll(…) Sets VerticalScroll to Auto.
static BindCommand(…) Binds the semantic command invoked by a segment button.
static BindCommand<T>(…) Binds the button’s semantic command to an observable value.
static BindContent(…) Binds the button content to an observable string value (creates a centered text label). (5 methods)
static BindContent<T>(…) Binds the button content element to an observable value. (2 methods)
static BindContent<TSource>(…) Binds the button content to a converted observable value (creates a centered text label). (5 methods)
static BindContent<T,TSource>(…) Binds the button content element to a converted observable value. (2 methods)
static BindIsActive(…) Binds the active state to an observable value.
static BindIsActive<TSource>(…) Binds the active state to a converted observable value.
static BindIsChecked(…) Binds the checked state to an observable value. (5 methods)
static BindIsChecked<TSource>(…) Binds the checked state to a converted observable value. (3 methods)
static BindIsChecked<T>(…) Binds the checked state to a converted observable value. (2 methods)
static BindIsEnabled<T>(…) Binds the enabled state to an observable value.
static BindIsEnabled<T,TSource>(…) Binds the enabled state to a converted observable value.
static BindIsExpanded(…) Binds the expanded state to an observable value.
static BindIsExpanded<TSource>(…) Binds the expanded state to a converted observable value.
static BindIsIndeterminate(…) Binds the indeterminate state to an observable value. (2 methods)
static BindIsIndeterminate<TSource>(…) Binds the indeterminate state to a converted observable value. (2 methods)
static BindIsVisible<T>(…) Binds the visibility state to an observable value.
static BindIsVisible<T,TSource>(…) Binds the visibility state to a converted observable value.
static BindPassword(…) Binds the password to an observable value.
static BindPassword<TSource>(…) Binds the password to a converted observable value.
static BindSelectedDate(…) Binds the selected date to an observable value. (2 methods)
static BindSelectedDate<TSource>(…) Binds the selected date to a converted observable value. (2 methods)
static BindSelectedIndex(…) Binds the selected index to an observable value. (4 methods)
static BindSelectedIndex<TSource>(…) Binds the selected index to a converted observable value. (3 methods)
static BindText(…) Binds the text to an observable value. (3 methods)
static BindText<T>(…) Binds the text to an observable value.
static BindText<TSource>(…) Binds the text to a converted observable value. (3 methods)
static BindText<T,TSource>(…) Binds the text to a converted observable value.
static BindValue(…) Binds the value to an observable value. (5 methods)
static BindValue<TSource>(…) Binds the value to a converted observable value. (4 methods)
static Bold(…) Sets the font weight to bold.
static Bold<T>(…) Sets the font weight to bold.
static BorderThickness(…) Sets the per-side border thickness.
static Build<TWindow>(…) Defines and immediately runs the window’s build at the composition site. The callback becomes the build owner (a virtual OnBuild override is then not invoked) and is re-run by Hot Reload when edited.
static Check(…) Sets IsChecked to true.
static ClearContainer<T>(…) Releases what PrepareContainer attached outside the template context, before the container takes another item. Most hooks need no counterpart: context subscriptions and container properties are undone for you. (6 methods)
static Collapse(…) Collapses a node.
static Command<T>(…) Sets the semantic command invoked by the button.
static Content(…) Sets the button content to a centered text label. When accessKey is true (default), “_” prefixes mark access key characters (e.g., “_Save” registers Alt+S). (6 methods)
static Content<T>(…) Sets the content to a text label. When accessKey is true (default), “_” prefixes mark access key characters (e.g., “_Save” registers Alt+S).
static CornerRadius(…) Sets the per-corner radius.
static Disable<T>(…) Sets IsEnabled to false.
static Enable<T>(…) Sets IsEnabled to true.
static Expand(…) Expands a node.
static FixedHeightPresenter(…) Uses fixed-height row virtualization with theme default item height. (7 methods)
static FontSize(…) Sets the font size resolved once from the current theme’s ThemeMetrics; themes with per-variant metrics re-resolve by calling this inside a WithTheme callback.
static FontSize<T>(…) Sets the font size resolved once from the current theme’s ThemeMetrics; themes with per-variant metrics re-resolve by calling this inside a WithTheme callback.
static FooterItems<T>(…) Sets the footer list’s items, template and FooterContentSelector from the items and the selectors, with arbitrary Element icons; a returned instance cannot be shared by rows at the same time. (2 methods)
static Header(…) Sets the header text. (3 methods)
static Header<T>(…) Sets the header text. (2 methods)
static Indeterminate(…) Sets IsChecked to null, the indeterminate state.
static IsChecked(…) Sets the checked state; null is indeterminate.
static Italic(…) Sets the font style to italic, or back to upright.
static Italic<T>(…) Sets the font style to italic, or back to upright.
static Item(…) Adds a semantic command item. (4 methods)
static Items(…) Sets ItemsSource to a view over the strings. (4 methods)
static Items<TSelf>(…) Sets ItemsSource to a view over the strings, one segment each.
static Items<T>(…) Sets ItemsSource to a view over the items, with an optional text selector. (8 methods)
static Items<TSelf,T>(…) Sets ItemsSource to a view over the items, one segment each, with an optional text selector.
static ItemsSource(…) Sets the items source. (5 methods)
static ItemsSource<TSelf>(…) Sets the items source.
static ItemTemplate(…) Sets the item template. (3 methods)
static ItemTemplate<TSelf>(…) Sets the segment template.
static ItemTemplate<TItem>(…) Sets the item template using delegate-based templating. (5 methods)
static NoHorizontalScroll(…) Sets HorizontalScroll to Disabled.
static NoVerticalScroll(…) Sets VerticalScroll to Disabled.
static OnCanClick<T>(…) Sets the predicate asked whether the button can be clicked.
static OnChecked(…) Adds a checked event handler.
static OnCheckedChanged(…) Adds a checked changed event handler.
static OnCheckStateChanged(…) Adds a CheckedChanged handler that receives the three-state value.
static OnCollapsing(…) Adds a handler that runs immediately before a tree item is collapsed.
static OnDoubleClick<T>(…) Adds a left-button double click handler.
static OnExpanding(…) Adds a handler that runs immediately before a tree item is expanded.
static OnSelectedNodeChanged(…) Adds a selected node changed event handler.
static OnSelectionChanged(…) Adds a selection changed event handler.
static OnSizeChanged<TWindow>(…) Adds a client size changed event handler.
static OnUnchecked(…) Adds an unchecked event handler.
static PrepareContainer<T>(…) Configures the container of each item once its content is bound, so behavior can be attached to the whole item rather than to the template. The container is the ItemContainer the list box places around every item. (8 methods)
static Range<T>(…) Sets Minimum and Maximum.
static Scroll(…) Sets VerticalScroll and HorizontalScroll.
static SelectedItemTemplate(…) Sets the template that presents the selected item in the header. Without it the header falls back to the item template, then to the item text.
static SelectedItemTemplate<TItem>(…) Sets the selected item template using delegate-based templating.
static SemiBold(…) Sets the font weight to semi-bold.
static SemiBold<T>(…) Sets the font weight to semi-bold.
static Separator(…) Adds a separator.
static ShowHorizontalScroll(…) Sets HorizontalScroll to Visible.
static ShowVerticalScroll(…) Sets VerticalScroll to Visible.
static StackPresenter(…) Uses non-virtualizing stack layout (all items realized). (3 methods)
static SubMenu(…) Adds a submenu.
static Tab(…) Adds a tab with text header. (2 methods)
static TabItems(…) Sets the tab items.
static ThreeState(…) Sets IsThreeState to true.
static Toggle(…) Toggles a node expansion state.
static ToolTip<T>(…) Sets the tooltip text.
static Uncheck(…) Sets IsChecked to false.
static VariableHeightPresenter(…) Uses variable-height virtualization (items are measured individually). (4 methods)
static WithTheme<T>(…) Registers a theme callback.
static WrapPresenter(…) Uses wrap-grid virtualization with fixed item size. (2 methods)