combobox绑定数据源可以绑定一个class吗

ComboBox class - Windows app development
ComboBox class
Expand the table of content
ComboBox class
Represents a selection control that combines a non-editable text box and a drop-down list box that allows users to select an item from a list.
Inheritance
public class ComboBox : Selector
XAML Object Element Usage
&ComboBox .../&
The ComboBox class has these types of members:
Constructors
The ComboBox class has these constructors.
ConstructorDescription
Initializes a new instance of the ComboBox class.
The ComboBox class has these events.
EventDescription
Occurs when the access key sequence is complete to notify controls that they should hide access key visuals. (Inherited from )
Occurs when the access key sequence is started to notify controls that they should show access key visuals. (Inherited from )
Occurs when a user completes an access key sequence to notify the element that the access key action should be invoked. (Inherited from )
Occurs when a context input gesture continues into a manipulation gesture, to notify the element that the context flyout should not be opened. (Inherited from )
Occurs when the user has completed a context input gesture, such as a right-click. (Inherited from )
Occurs when the value of the FrameworkElement.DataContext property changes. (Inherited from )
Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element. (Inherited from )
Occurs when the input system reports an underlying drag event with this element as the target. (Inherited from )
Occurs when the input system reports an underlying drag event with this element as the origin. (Inherited from )
Occurs when the input system reports an underlying drag event with this element as the potential drop target. (Inherited from )
Occurs when a drag operation is initiated. (Inherited from )
Occurs when the input system reports an underlying drop event with this element as the drop target. (Inherited from )
Occurs when a drag-and-drop operation is ended. (Inherited from )
Occurs when the drop-down portion of the
Occurs when the drop-down portion of the ComboBox
Occurs when the control disengages game pad mouse simulation. (Inherited from )
Occurs when the control engages game pad mouse simulation. (Inherited from )
Occurs when a UIElement receives focus. (Inherited from )
Occurs when an otherwise unhandled Hold interaction occurs over the hit test area of this element. (Inherited from )
Occurs when the IsEnabled property changes. (Inherited from )
Occurs when a keyboard key is pressed while the UIElement has focus. (Inherited from )
Occurs when a keyboard key is released while the UIElement
has focus. (Inherited from )
Occurs when the layout of the visual tree changes, due to layout-relevant properties changing value or some other action that refreshes the layout. (Inherited from )
Occurs when a FrameworkElement has been constructed and added to the object tree, and is ready for interaction. (Inherited from )
Occurs when a FrameworkElement begins to load. (Inherited from )
Occurs when a UIElement loses focus. (Inherited from )
Occurs when a manipulation on the UIElement is complete. (Inherited from )
Occurs when the input device changes position during a manipulation. (Inherited from )
Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (Inherited from )
Occurs when an input device begins a manipulation on the UIElement. (Inherited from )
Occurs when the manipulation processor is first created. (Inherited from )
Occurs when a pointer that made contact abnormally loses contact. (Inherited from )
Occurs when pointer capture previously held by this element moves to another element or elsewhere. (Inherited from )
Occurs when a pointer enters the hit test area of this element. (Inherited from )
Occurs when a pointer leaves the hit test area of this element. (Inherited from )
Occurs when a pointer moves while the pointer remains within the hit test area of this element. (Inherited from )
Occurs when the pointer device initiates a Press action within this element. (Inherited from )
Occurs when the pointer device that previously initiated a Press action is released, while within this element. (Inherited from )
Occurs when the delta value of a pointer wheel changes. (Inherited from )
Occurs when a right-tap input stimulus happens while the pointer is over the element. (Inherited from )
Occurs when the currently selected item changes. (Inherited from )
Occurs when either the ActualHeight or the ActualWidth property changes value on a FrameworkElement. (Inherited from )
Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element. (Inherited from )
Occurs when this object is no longer connected to the main object tree. (Inherited from )
The ComboBox class has these methods. It also inherits methods from the Object class.
MethodDescription
Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked even if the event is handled elsewhere. (Inherited from )
Loads the relevant control template so that its parts can be referenced. (Inherited from )
Positions child objects and determines a size for a UIElement. Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update. (Inherited from )
Provides the behavior for the Arrange pass of layout. Classes can override this method to define their own Arrange pass behavior. (Inherited from )
Cancels ongoing direct manipulation processing (system-defined panning/zooming) on any ScrollViewer parent that contains the current UIElement. (Inherited from )
Sets pointer capture to a UIElement.
Once captured, only the element that has capture will fire pointer-related events. (Inherited from )
Undoes the effects of the PrepareContainerForItemOverride method. (Inherited from )
Clears the local value of a dependency property. (Inherited from )
Returns the container for the item at the specified index within the ItemCollection. (Inherited from )
Returns the container corresponding to the specified item. (Inherited from )
Retrieves an object that has the specified identifier name. (Inherited from )
Enables a UIElement subclass to expose child elements that assist with resolving touch targeting. (Inherited from )
Attempts to set the focus on the control. (Inherited from )
Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from )
Returns the BindingExpression that represents the binding on the specified property. (Inherited from )
Creates or identifies the element that is used to display the given item. (Inherited from )
Retrieves the named element in the instantiated ControlTemplate visual tree. (Inherited from )
Returns the current effective value of a dependency property from a DependencyObject. (Inherited from )
When implemented in a derived class, enables per-state construction of a visual tree for a control template in code, rather than by loading XAML for all states at control startup. (Inherited from )
Returns the group header container that corresponds to the specified container element. (Inherited from )
Returns the index to the item that has the specified, generated container. (Inherited from )
Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously. (Inherited from )
Invalidates the measurement state (layout) for a UIElement. (Inherited from )
Determines whether the specified item is (or is eligible to be) its own container. (Inherited from )
Returns the item that corresponds to the specified, generated container. (Inherited from )
Updates the DesiredSize of a UIElement. Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride implementations to form a recursive layout update. (Inherited from )
Provides the behavior for the Measure pass of the layout cycle. Classes can override this method to define their own Measure pass behavior. (Inherited from )
Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. (Inherited from )
When implemented in a derived class, returns class-specific AutomationPeer implementations for the Microsoft UI Automation infrastructure. (Inherited from )
Override this method to implement how layout and logic should behave when items are removed from
a class-specific content or children property. (Inherited from )
Called before the DoubleTapped event occurs. (Inherited from )
Called before the DragEnter event occurs. (Inherited from )
Called before the DragLeave event occurs. (Inherited from )
Called before the DragOver event occurs. (Inherited from )
Called before the Drop event occurs. (Inherited from )
Invoked when the DropDownClosed event is raised.
Invoked when the DropDownOpened event is raised.
Called before the GotFocus event occurs. (Inherited from )
Invoked when the value of the GroupStyleSelector property changes. (Inherited from )
Called before the Holding event occurs. (Inherited from )
Invoked when the value of the ItemContainerStyle property changes. (Inherited from )
Invoked when the value of the ItemContainerStyleSelector property changes. (Inherited from )
Invoked when the value of the Items property changes. (Inherited from )
Invoked when the value of the ItemTemplate property changes. (Inherited from )
Invoked when the value of the ItemTemplateSelector property changes. (Inherited from )
Called before the KeyDown event occurs. (Inherited from )
Called before the KeyUp event occurs. (Inherited from )
Called before the LostFocus event occurs. (Inherited from )
Called before the ManipulationCompleted event occurs. (Inherited from )
Called before the ManipulationDelta event occurs. (Inherited from )
Called before the ManipulationInertiaStarting event occurs. (Inherited from )
Called before the ManipulationStarted event occurs. (Inherited from )
Called before the
ManipulationStarting event occurs. (Inherited from )
Called before the PointerCanceled event occurs. (Inherited from )
Called before the PointerCaptureLost event occurs. (Inherited from )
Called before the PointerEntered event occurs. (Inherited from )
Called before the PointerExited event occurs. (Inherited from )
Called before the PointerMoved event occurs. (Inherited from )
Called before the PointerPressed event occurs. (Inherited from )
Called before the PointerReleased event occurs. (Inherited from )
Called before the PointerWheelChanged event occurs. (Inherited from )
Called before the RightTapped event occurs. (Inherited from )
Called before the Tapped event occurs. (Inherited from )
Prepares the specified element to display the specified item. (Inherited from )
Returns the local value of a dependency property, if a local value is set. (Inherited from )
Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance. (Inherited from )
Releases pointer captures for capture of one specific pointer by this UIElement. (Inherited from )
Releases all pointer captures held by this element. (Inherited from )
Disables game pad mouse simulation. (Inherited from )
Removes the specified routed event handler from this UIElement. Typically the handler in question was added by AddHandler. (Inherited from )
Attaches a binding to a FrameworkElement, using the provided binding object. (Inherited from )
Sets the local value of a dependency property on a DependencyObject. (Inherited from )
Initiates a drag-and-drop operation. (Inherited from )
Returns a transform object that can be used to transform coordinates from the UIElement to the specified object. (Inherited from )
Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from )
Ensures that all positions of child objects of a UIElement are properly updated for layout. (Inherited from )
Properties
The ComboBox class has these properties.
PropertyAccess typeDescription
Read/write
Gets or sets the access key (mnemonic) for this element. (Inherited from )
Read/write
Gets or sets a source element that provides the access key scope for this element, even if it's not in the visual tree of the source element. (Inherited from )
Gets the rendered height of a FrameworkElement. See Remarks. (Inherited from )
Gets the rendered width of a FrameworkElement. See Remarks. (Inherited from )
Read/write
Gets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations. (Inherited from )
Read/write
Gets or sets a value that indicates whether the element automatically gets focus when the user interacts with it. (Inherited from )
Read/write
Gets or sets whether a disabled control can receive focus. (Inherited from )
Read/write
Gets or sets a brush that provides the background of the control. (Inherited from )
Gets a Uniform Resource Identifier (URI) that represents the base Uniform Resource Identifier (URI) for an XAML-constructed object at XAML load time. This property is useful for Uniform Resource Identifier (URI) resolution at run time. (Inherited from )
Read/write
Gets or sets a brush that describes the border fill of a control. (Inherited from )
Read/write
Gets or sets the border thickness of a control. (Inherited from )
Read/write
Gets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible. (Inherited from )
Gets or sets a value that indicates whether the element can be dragged as data in a drag-and-drop operation. (Inherited from )
Read/write
Gets or sets the uniform spacing between characters, in units of 1/1000 of an em. (Inherited from )
Read/write
Gets or sets the RectangleGeometry used to define the outline of the contents of a UIElement. (Inherited from )
Read/write
Gets or sets a property that declares alternate composition and blending modes for the element in its parent layout and window. This is relevant for elements that are involved in a mixed XAML / Microsoft DirectX UI. (Inherited from )
Read/write
Gets or sets the flyout associated with this element. (Inherited from )
Read/write
Gets or sets the data context for a FrameworkElement when it participates in data binding. (Inherited from )
Read/write
Gets or sets the key that references the default style for the control. Authors of custom controls use this property to change the default for the style that their control uses. (Inherited from )
Gets the size that this UIElement computed during the measure pass of the layout process. (Inherited from )
Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. (Inherited from )
Read/write
Gets or sets the name or path of the property that is displayed for each data item. (Inherited from )
Read/write
Get or sets a value that specifies a control's preference for whether sounds are played. (Inherited from )
Read/write
Gets or sets a value that specifies whether the access key display is dismissed when an access key is invoked. (Inherited from )
Read/write
Gets or sets the direction in which text and other UI elements flow within any parent element that controls their layout. This property can be set to either LeftToRight or RightToLeft.
Setting FlowDirection to RightToLeft on any element sets the alignment to the right, the reading order to right-to-left and the layout of the control to flow from right to left. (Inherited from )
Gets a value that specifies whether this control has focus, and the mode by which focus was obtained. (Inherited from )
Read/write
Gets or sets the outer margin of the focus visual for a FrameworkElement. (Inherited from )
Read/write
Gets or sets the brush used to draw the outer border of a HighVisibility focus visual
for a FrameworkElement. (Inherited from )
Read/write
Gets or sets the thickness of the outer border of a HighVisibility focus visual
for a FrameworkElement. (Inherited from )
Read/write
Gets or sets the brush used to draw the inner border of a HighVisibility focus visual
for a FrameworkElement. (Inherited from )
Read/write
Gets or sets the thickness of the inner border of a HighVisibility focus visual
for a FrameworkElement. (Inherited from )
Read/write
Gets or sets the font used to display text in the control. (Inherited from )
Read/write
Gets or sets the size of the text in this control. (Inherited from )
Read/write
Gets or sets the degree to which a font is condensed or expanded on the screen. (Inherited from )
Read/write
Gets or sets the style in which the text is rendered. (Inherited from )
Read/write
Gets or sets the thickness of the specified font. (Inherited from )
Read/write
Gets or sets a brush that describes the foreground color. (Inherited from )
Gets a collection of GroupStyle objects that define the appearance of each level of groups. (Inherited from )
Read/write
Gets or sets a reference to a custom GroupStyleSelector logic class. The GroupStyleSelector returns different GroupStyle values to use for content based on the characteristics of that content. (Inherited from )
Read/write
Gets or sets the content for the control's header.
Identifies the Header dependency property.
Read/write
Gets or sets the DataTemplate used to display the content of the control's header.
Identifies the HeaderTemplate
dependency property.
Read/write
Gets or sets the suggested height of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control. (Inherited from )
Read/write
Gets or sets the horizontal alignment of the control's content. (Inherited from )
Read/write
Gets or sets a value that indicates whether an element defines its own access key scope. (Inherited from )
Read/write
Gets or sets a value that determines whether the DoubleTapped event can originate from that element. (Inherited from )
Read/write
Gets or sets a value that indicates whether the drop-down portion of the ComboBox
is currently open.
Identifies the IsDropDownOpen dependency property.
Gets a value that indicates whether the user can edit text in the text box portion of the ComboBox. This property always returns false.
Read/write
Gets or sets a value indicating whether the user can interact with the control. (Inherited from )
Read/write
Get or sets a value that indicates whether game pad mouse simulation is engaged. (Inherited from )
Read/write
Get or sets a value that indicates whether game pad mouse simulation can be engaged. (Inherited from )
Gets a value that indicates whether the control is using grouping. (Inherited from )
Read/write
Gets or sets whether the contained area of this UIElement can return true values for hit testing. (Inherited from )
Read/write
Gets or sets a value that determines whether the Holding event can originate from that element. (Inherited from )
Read/write
Gets or sets a value that determines whether the RightTapped
event can originate from that element. (Inherited from )
Gets a value that indicates whether the SelectionBoxItem component is highlighted.
Read/write
Gets or sets a value that indicates whether a Selector should keep the SelectedItem synchronized with the current item in the Items property. (Inherited from )
Read/write
Gets or sets a value that indicates whether a control is included in tab navigation. (Inherited from )
Read/write
Gets or sets a value that determines whether the Tapped
event can originate from that element. (Inherited from )
Read/write
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled. (Inherited from )
Read/write
Gets or sets a value that specifies whether a user can jump to a value by typing.
Identifies the IsTextSearchEnabled dependency property.
Gets the ItemContainerGenerator associated with this ItemsControl. (Inherited from )
Read/write
Gets or sets the style that is used when rendering the item containers. (Inherited from )
Read/write
Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to use for the item container based on characteristics of the object being displayed. (Inherited from )
Read/write
Gets or sets the collection of Transition style elements that apply to the item containers of an ItemsControl. (Inherited from )
Gets the collection used to generate the content of the control. (Inherited from )
Read/write
Gets or sets the template that defines the panel that controls the layout of items. (Inherited from )
Gets the Panel specified by ItemsPanel. (Inherited from )
Read/write
Gets or sets an object source used to generate the content of the ItemsControl. (Inherited from )
Read/write
Gets or sets the DataTemplate used to display each item. (Inherited from )
Read/write
Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by this property returns a template to apply to items. (Inherited from )
Read/write
Gets or sets localization/globalization language information that applies to a FrameworkElement, and also to all child elements of the current FrameworkElement in the object representation and in UI. (Inherited from )
Read/write
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
Identifies the LightDismissOverlayMode dependency property.
Read/write
Gets or sets the ManipulationModes value used for UIElement behavior and interaction with gestures. Setting this value enables handling the manipulation events from this element in app code. (Inherited from )
Read/write
Gets or sets the outer margin of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the maximum height for a combo box drop-down.
Identifies the MaxDropDownHeight dependency property.
Read/write
Gets or sets the maximum height constraint of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the maximum width constraint of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the minimum height constraint of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the minimum width constraint of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name. (Inherited from )
Read/write
Gets or sets the degree of the object's opacity. (Inherited from )
Read/write
Gets or sets the padding inside a control. (Inherited from )
Gets the parent object of this FrameworkElement in the object tree. (Inherited from )
Read/write
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
Identifies the
PlaceholderText dependency property.
Gets the set of all captured pointers, represented as Pointer values. (Inherited from )
Read/write
Gets or sets the perspective projection (3-D effect) to apply when rendering this element. (Inherited from )
Gets the final render size of a UIElement. (Inherited from )
Read/write
Gets or sets transform information that affects the rendering position of a UIElement. (Inherited from )
Read/write
Gets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement. (Inherited from )
Read/write
Gets or sets the
UI theme that is used by the UIElement
(and its child elements) for resource determination. The UI theme you specify with RequestedTheme can override the app-level RequestedTheme. (Inherited from )
Read/write
Gets or sets a value that indicates when an element requires a mouse-like pointer behavior from a game pad. (Inherited from )
Read/write
Gets the locally defined resource dictionary. In XAML, you can establish resource items as child object elements of a frameworkElement.Resources property element, through XAML implicit collection syntax. (Inherited from )
Read/write
Gets or sets the index of the selected item. (Inherited from )
Read/write
Gets or sets the selected item. (Inherited from )
Read/write
Gets or sets the value of the selected item, obtained by using the SelectedValuePath. (Inherited from )
Read/write
Gets or sets the property path that is used to get the SelectedValue property of the SelectedItem property. (Inherited from )
Gets the item shown when the ComboBox is closed.
Gets the template applied to the selection box content.
Read/write
Gets or sets an instance Style that is applied for this object during layout and rendering. (Inherited from )
Read/write
Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by pressing the Tab key. (Inherited from )
Read/write
Gets or sets a value that modifies how tabbing and TabIndex work for this control. (Inherited from )
Read/write
Gets or sets an arbitrary object value that can be used to store custom information about this object. (Inherited from )
Read/write
Gets or sets a control template. The control template defines the visual appearance of a control in UI, and is defined in XAML markup. (Inherited from )
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining templates for a ComboBox control.
Gets or sets the 3-D transform effect to apply when rendering this element. (Inherited from )
Read/write
Gets or sets the collection of Transition style elements that apply to a UIElement. (Inherited from )
Gets the collection of triggers for animations that are defined for a FrameworkElement.
Not commonly used. (Inherited from )
Read/write
Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels. (Inherited from )
Read/write
Gets or sets a value that indicates whether the control uses focus visuals that are drawn by the system or those defined in the control template. (Inherited from )
Read/write
Gets or sets the vertical alignment characteristics that are applied to a FrameworkElement when it is composed in a parent object such as a panel or items control. (Inherited from )
Read/write
Gets or sets the vertical alignment of the control's content. (Inherited from )
Read/write
Gets or sets the visibility of a UIElement. A UIElement that is not visible is not rendered and does not communicate its desired size to layout. (Inherited from )
Read/write
Gets or sets the width of a FrameworkElement. (Inherited from )
Read/write
Gets or sets the object that gets focus when a user presses the Directional Pad (D-pad) down. (Inherited from )
Read/write
Gets or sets the object that gets focus when a user presses the Directional Pad (D-pad) left. (Inherited from )
Read/write
Gets or sets the object that gets focus when a user presses the Directional Pad (D-pad) right. (Inherited from )
Read/write
Gets or sets the object that gets focus when a user presses the Directional Pad (D-pad) up. (Inherited from )
ComboBox presents a drop-down list of items a user can select from.Use a ComboBox to present a list of items that a user can select from. When the ComboBox is closed, it either displays the current selection or is empty if there is no selected item. When the ComboBox is open, it displays the list of selectable items. You can get or set the combo box's selected item by using the
property, and get or set the index of the selected item by using the
You populate the ComboBox by adding objects directly to the
collection or by binding the
property to a data source. Items added to the ComboBox
are wrapped in
containers.
ComboBox uses a
as its . Using a different panel as the ItemsPanel is not supported and might result in undesired behavior.
Control style and template
You can modify the default
to give the control a unique appearance. For information about modifying a control's style and template, see . The default style, template, and resources that define the look of the control are included in the generic.xaml file. For design purposes,
generic.xaml is available in the \(Program Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\&SDK version&\Generic folder from a Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might have different values.
Starting in Windows 10, version 1607 (Windows SDK version 10.0.14393.0), generic.xaml includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. In apps that target this SDK or later, modifying these resources is preferred to setting properties such as
and . For more info, see the
section of the
This table shows the resources used by the ComboBox control.
Resource keyDescription
ComboBoxBackgroundBackground color at rest
ComboBoxBackgroundPointerOverBackground color on hover
ComboBoxBackgroundPressedBackground color when pressed
ComboBoxBackgroundDisabledBackground color when disabled
ComboBoxBackgroundUnfocusedBackground color when unfocused
ComboBoxBackgroundBorderBrushFocusedBorder color around box after item has been selected and control has focus
ComboBoxBackgroundBorderBrushUnfocusedBorder color around box after item has been selected and control is unfocused
ComboBoxForegroundText color of selected item at rest
ComboBoxForegroundDisabledText color of selected item when disabled
ComboBoxForegroundFocusedText color of selected item when focused
ComboBoxForegroundFocusedPressedText color of selected item pressed and focused
ComboBoxPlaceHolderForegroundPlaceholder text color
ComboBoxPlaceHolderForegroundFocusedPressedPlaceholder text color when pressed and focused
ComboBoxBorderBrushBorder color
ComboBoxBorderBrushPointerOverBorder color on hover
ComboBoxBorderBrushPressedBorder color when pressed
ComboBoxBorderBrushDisabledBorder color when disabled
ComboBoxDropDownGlyphForegroundDrop down arrow color
ComboBoxDropDownGlyphForegroundDisabledDrop down arrow color when disabled
ComboBoxDropDownGlyphForegroundFocusedDrop down arrow color when focused
ComboBoxDropDownGlyphForegroundFocusedPressedDrop down arrow color when focused and pressed
ComboBoxDropDownBackgroundBackground color of drop down arrow control bounds
ComboBoxDropDownForegroundNot used
ComboBoxDropDownBorderBrushBorder color around control's popup when selecting items
The following example demonstrates binding a ComboBox to a collection of
&ComboBox x:Name="FontsCombo" Header="Fonts" Height="44" Width="296"
ItemsSource="{x:Bind fonts}" DisplayMemberPath="Source"/&
ObservableCollection&FontFamily& fonts = new ObservableCollection&FontFamily&();
public MainPage()
this.InitializeComponent();
fonts.Add(new FontFamily("Arial"));
fonts.Add(new FontFamily("Courier New"));
fonts.Add(new FontFamily("Times New Roman"));
Requirements (Windows 10 device family)
Universal, introduced version 10.0.10240.0
API contract
Windows.Foundation.UniversalApiContract, introduced version 1.0
Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]
Windows.Foundation.UniversalApiContract.winmd
Requirements (Windows 8.x and Windows Phone 8.x)
Minimum supported client
Windows 8 [Windows Store apps only]
Minimum supported server
Windows Server 2012 [Windows Store apps only]
Minimum supported phone
Windows Phone 8.1 [Windows Runtime apps only]
Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]
Windows.winmd
Attributes
Related controls
IN THIS ARTICLE
Is this page helpful?
Additional feedback?
1500 characters remaining
Thank you!
We appreciate your feedback.}

我要回帖

更多关于 combobox绑定数据源 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信