![]() Gets or sets the data template used to display the content of the ContentControl. Gets or sets a composite string that specifies how to format the Content property if it is displayed as a string. Gets or sets the content of a ContentControl. A CommandBinding enables command handling for this element, and declares the linkage between a command, its events, and the handlers attached by this element. Gets a collection of CommandBinding objects associated with this element. ![]() Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this element) to fit into the size of the containing element. Gets or sets the geometry used to define the outline of the contents of an element. Gets or sets a cached representation of the UIElement. Gets or sets the border thickness of a control. Gets or sets a brush that describes the border background of a control. Gets or sets an input source for the bitmap effect that applies directly to the rendered content for this element. Gets or sets the BindingGroup that is used for the element. Gets or sets a brush that describes the background of a control. Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. Gets a value that indicates whether at least one touch is pressed over this element. Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree. ![]() Gets a value that indicates whether at least one touch is captured to this element. Gets or sets a value indicating whether this element can be used as the target of a drag-and-drop operation. Gets the rendered height of this element. Identifies the HasContent dependency property. Identifies the ContentTemplateSelector dependency property. Identifies the ContentTemplate dependency property. Identifies the ContentStringFormat dependency property. Identifies the Content dependency property. Initializes a new instance of the ContentControl class. The default style is determined by which desktop theme is used when the application is running. If a property is set by a default style, the property might change from its default value when the control appears in the application. For more information, see How to: Bind to a Collection and Display Information Based on Selection.ĭependency properties for this control might be set by the control's default style. Another typical scenario is to use the ContentControl to show more information about an item selected in an ItemsControl control. For more information, see Data Templating Overview. If you want to enhance the appearance of the control, you can create a new DataTemplate. The following illustration shows four buttons whose Content property is set to one of the following:Ī Panel control that contains other UIElement objects.įour buttons with different types of contentĪ ContentControl has a limited default style. This enables you to add rich content to controls such as Button and CheckBox. The ContentControl can contain any type of common language runtime object (such as a string or a DateTime object) or a UIElement object (such as a Rectangle or a Panel). The following example shows how to make a style for a ContentControl so that the control has an enhanced visual appearance. TextBlock1.TextAlignment = TextAlignment.Center ![]() ' Add a panel that contains multpile objects to a button. StringContent.Content = "This is string content of a Button"ĭim dateTime1 As New DateTime(2004, 3, 4, 13, 6, 55) StackPanel stackPanel1 = new StackPanel() Create a Button with a panel that contains multiple objects Create a Button with a single UIElement as its content. Create a Button with a DateTime object as its content.ĭateTime dateTime1 = new DateTime(2004, 3, 4, 13, 6, 55) StringContent.Content = "This is string content of a Button" Create a Button with a string as its content. For more information, see XAML Overview (WPF). Although the Extensible Application Markup Language (XAML) version of the example could use the tags around the content of each button, it is not necessary. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |