diff --git a/includes/visual-property-note.md b/includes/visual-property-note.md index d27d41c1e6a..13469bd37ba 100644 --- a/includes/visual-property-note.md +++ b/includes/visual-property-note.md @@ -1,3 +1,2 @@ > [!NOTE] -> Setting a visual property only has an effect if that property is both present in the control's default template and is set by using a [TemplateBinding](/dotnet/framework/wpf/advanced/templatebinding-markup-extension). You can find a list of visual properties in the [Changing the Visual Structure of a Control](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control#changing-the-visual-structure-of-a-control) section in the [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control) article. - +> Setting a visual property only has an effect if that property is both present in the control's default template and set by using a [TemplateBinding](/dotnet/framework/wpf/advanced/templatebinding-markup-extension). diff --git a/xml/System.Windows.Controls.Primitives/DatePickerTextBox.xml b/xml/System.Windows.Controls.Primitives/DatePickerTextBox.xml index 606784e2725..57ea83c03dd 100644 --- a/xml/System.Windows.Controls.Primitives/DatePickerTextBox.xml +++ b/xml/System.Windows.Controls.Primitives/DatePickerTextBox.xml @@ -29,18 +29,18 @@ Represents the text input of a . - control enables users to type a date directly into a . - -## Customizing the DatePickerTextBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [DatePicker Styles and Templates](/dotnet/framework/wpf/controls/datepicker-styles-and-templates). - + control enables users to type a date directly into a . + +## Customizing the DatePickerTextBox Control + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [DatePicker Styles and Templates](/dotnet/framework/wpf/controls/datepicker-styles-and-templates). + Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. - -[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] - + +[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] + ]]> diff --git a/xml/System.Windows.Controls.Primitives/RepeatButton.xml b/xml/System.Windows.Controls.Primitives/RepeatButton.xml index 48fa03d2407..14decf48472 100644 --- a/xml/System.Windows.Controls.Primitives/RepeatButton.xml +++ b/xml/System.Windows.Controls.Primitives/RepeatButton.xml @@ -32,7 +32,7 @@ The class represents a control that is similar to a . However, repeat buttons give you control over when and how the event occurs. The raises the event repeatedly from the time it is pressed until it is released. The property determines when the event begins. You can also control the interval of the repetitions with the property. ## Customizing the RepeatButton Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [RepeatButton Styles and Templates](/dotnet/framework/wpf/controls/repeatbutton-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [RepeatButton Styles and Templates](/dotnet/framework/wpf/controls/repeatbutton-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls.Primitives/ScrollBar.xml b/xml/System.Windows.Controls.Primitives/ScrollBar.xml index db2e706ebf2..4fe82558144 100644 --- a/xml/System.Windows.Controls.Primitives/ScrollBar.xml +++ b/xml/System.Windows.Controls.Primitives/ScrollBar.xml @@ -58,7 +58,7 @@ To display content inside a box that has scroll bars, use the control. ## Customizing the ScrollBar Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ScrollBar Styles and Templates](/dotnet/framework/wpf/controls/scrollbar-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ScrollBar Styles and Templates](/dotnet/framework/wpf/controls/scrollbar-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls.Primitives/StatusBar.xml b/xml/System.Windows.Controls.Primitives/StatusBar.xml index 6636de5a8b3..c66983609f8 100644 --- a/xml/System.Windows.Controls.Primitives/StatusBar.xml +++ b/xml/System.Windows.Controls.Primitives/StatusBar.xml @@ -48,7 +48,7 @@ ![Status bar](~/add/media/ss-ctl-statusbar.GIF "Status bar") ## Customizing the StatusBar Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [StatusBar Styles and Templates](/dotnet/framework/wpf/controls/statusbar-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [StatusBar Styles and Templates](/dotnet/framework/wpf/controls/statusbar-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls.Primitives/Thumb.xml b/xml/System.Windows.Controls.Primitives/Thumb.xml index 35f6a6d2559..b1605d2067b 100644 --- a/xml/System.Windows.Controls.Primitives/Thumb.xml +++ b/xml/System.Windows.Controls.Primitives/Thumb.xml @@ -52,7 +52,7 @@ ![Scrollbar illustration](~/add/media/scrollbar-illustration.JPG "Scrollbar illustration") ## Customizing the Thumb Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Thumb Styles and Templates](/dotnet/framework/wpf/controls/thumb-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Thumb Styles and Templates](/dotnet/framework/wpf/controls/thumb-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls.Primitives/ToggleButton.xml b/xml/System.Windows.Controls.Primitives/ToggleButton.xml index 3e9990d329a..2283c5b823f 100644 --- a/xml/System.Windows.Controls.Primitives/ToggleButton.xml +++ b/xml/System.Windows.Controls.Primitives/ToggleButton.xml @@ -38,7 +38,7 @@ The property specifies the state of the . The property specifies whether the has two or three states. ## Customizing the ToggleButton Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ToggleButton Styles and Templates](/dotnet/framework/wpf/controls/togglebutton-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ToggleButton Styles and Templates](/dotnet/framework/wpf/controls/togglebutton-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/Button.xml b/xml/System.Windows.Controls/Button.xml index 725df9dbd9b..38bebb9878a 100644 --- a/xml/System.Windows.Controls/Button.xml +++ b/xml/System.Windows.Controls/Button.xml @@ -36,20 +36,18 @@ The method marks the event as handled. To respond to the event, attach an event handler to the event, or call with `handledEventsToo` set to `true`. ## Customizing the Button Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Button Styles and Templates](/dotnet/framework/wpf/controls/button-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Button Styles and Templates](/dotnet/framework/wpf/controls/button-styles-and-templates). - Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. + Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. [!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] ## Examples The following example shows three buttons that respond to clicks in three different ways. -- Hover: the first button changes colors when the user hovers with the mouse over the button. - -- Press: the second button requires that the mouse be pressed while the mouse pointer is over the button. - -- Release: the third does not reset the background color of the buttons until the mouse is pressed and released on the button. +- Hover: the first button changes colors when the user hovers with the mouse over the button. +- Press: the second button requires that the mouse be pressed while the mouse pointer is over the button. +- Release: the third does not reset the background color of the buttons until the mouse is pressed and released on the button. :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/Button/Overview/Pane1.xaml" id="Snippet1"::: @@ -250,7 +248,7 @@ property is `true` when the property is set to `true` and the control that has focus does not accept ENTER as input. For example, in the **Run** dialog box, the **OK** button is the default button. When focus is on the text box, on the **OK** button is `true` because a user can activate the button by pressing ENTER. + The property is `true` when the property is set to `true` and the control that has focus does not accept ENTER as input. For example, in the **Run** dialog box, the **OK** button is the default button. When focus is on the text box, on the **OK** button is `true` because a user can activate the button by pressing ENTER. > [!NOTE] > If the default button has focus, is `false`. This is because the method handles ENTER, and it is not necessary for to be set to `true`. diff --git a/xml/System.Windows.Controls/Calendar.xml b/xml/System.Windows.Controls/Calendar.xml index 9f8bb63d0db..6878ee2ebde 100644 --- a/xml/System.Windows.Controls/Calendar.xml +++ b/xml/System.Windows.Controls/Calendar.xml @@ -71,7 +71,7 @@ |SPACEBAR or ENTER| or |Switches to the or represented by focused item.| ## Customizing the Calendar Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Calendar Styles and Templates](/dotnet/framework/wpf/controls/calendar-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Calendar Styles and Templates](/dotnet/framework/wpf/controls/calendar-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/CheckBox.xml b/xml/System.Windows.Controls/CheckBox.xml index 38596846338..f08b9c78c17 100644 --- a/xml/System.Windows.Controls/CheckBox.xml +++ b/xml/System.Windows.Controls/CheckBox.xml @@ -34,28 +34,28 @@ Represents a control that a user can select and clear. - controls inherit from and can have three states: checked (selected), unchecked (cleared), and indeterminate. - - A is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. - -## Customizing the CheckBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [CheckBox Styles and Templates](/dotnet/framework/wpf/controls/checkbox-styles-and-templates). - + controls inherit from and can have three states: checked (selected), unchecked (cleared), and indeterminate. + + A is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. + +## Customizing the CheckBox Control + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [CheckBox Styles and Templates](/dotnet/framework/wpf/controls/checkbox-styles-and-templates). + Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. - -[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] - -## Examples - The following example creates a and handles the , , and events. - - :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/CheckBox/Overview/Window1.xaml" id="Snippet4"::: - + +[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] + +## Examples + The following example creates a and handles the , , and events. + + :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/CheckBox/Overview/Window1.xaml" id="Snippet4"::: + :::code language="csharp" source="~/snippets/csharp/System.Windows.Controls/CheckBox/Overview/Window1.xaml.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/CheckBox_Snippets/VisualBasic/Window1.xaml.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/CheckBox_Snippets/VisualBasic/Window1.xaml.vb" id="Snippet5"::: + ]]> WPF Controls Gallery Sample @@ -180,13 +180,13 @@ The that contains the event data. Responds to a event. - event as handled by setting the property of the event data to `true` when the user presses the plus or the minus key. - - This method sets to `true` when the user presses the plus key and to `false` when the user presses the minus key. - + event as handled by setting the property of the event data to `true` when the user presses the plus or the minus key. + + This method sets to `true` when the user presses the plus key and to `false` when the user presses the minus key. + ]]> diff --git a/xml/System.Windows.Controls/ComboBox.xml b/xml/System.Windows.Controls/ComboBox.xml index c99ec9f583e..e8f3bfa9dcf 100644 --- a/xml/System.Windows.Controls/ComboBox.xml +++ b/xml/System.Windows.Controls/ComboBox.xml @@ -66,7 +66,7 @@ The is an , so it can display content other than simple strings. For example, you can create a that contains a list of images. When you have content other than strings in the , a nonsensical string might appear in the when the drop-down list is hidden. To display a string in the when it contains non-string items, use the or attached property. ## Customizing the ComboBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ComboBox Styles and Templates](/dotnet/framework/wpf/controls/combobox-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ComboBox Styles and Templates](/dotnet/framework/wpf/controls/combobox-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ComboBoxItem.xml b/xml/System.Windows.Controls/ComboBoxItem.xml index b3a414d9bb1..1e176aea7ed 100644 --- a/xml/System.Windows.Controls/ComboBoxItem.xml +++ b/xml/System.Windows.Controls/ComboBoxItem.xml @@ -40,7 +40,7 @@ A is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. ## Customizing the ComboBoxItem Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ComboBox Styles and Templates](/dotnet/framework/wpf/controls/combobox-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ComboBox Styles and Templates](/dotnet/framework/wpf/controls/combobox-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ContextMenu.xml b/xml/System.Windows.Controls/ContextMenu.xml index 81ac26afc9e..ba3e232f3f5 100644 --- a/xml/System.Windows.Controls/ContextMenu.xml +++ b/xml/System.Windows.Controls/ContextMenu.xml @@ -56,7 +56,7 @@ A is automatically placed inside a control. This behavior cannot be changed. ## Customizing the ContextMenu Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ContextMenu Styles and Templates](/dotnet/framework/wpf/controls/contextmenu-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ContextMenu Styles and Templates](/dotnet/framework/wpf/controls/contextmenu-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/DataGrid.xml b/xml/System.Windows.Controls/DataGrid.xml index b251a797d2c..6ccc559b980 100644 --- a/xml/System.Windows.Controls/DataGrid.xml +++ b/xml/System.Windows.Controls/DataGrid.xml @@ -90,7 +90,7 @@ To customize behavior, you can handle events for selection change, cell editing, and column re-ordering. The also exposes several events for row recycling that you can handle to customize rows. - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [DataGrid Styles and Templates](/dotnet/framework/wpf/controls/datagrid-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [DataGrid Styles and Templates](/dotnet/framework/wpf/controls/datagrid-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/DatePicker.xml b/xml/System.Windows.Controls/DatePicker.xml index 68864986f13..b525a1b3556 100644 --- a/xml/System.Windows.Controls/DatePicker.xml +++ b/xml/System.Windows.Controls/DatePicker.xml @@ -54,7 +54,7 @@ > The supports only the Gregorian calendar. ## Customizing the DatePicker Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [DatePicker Styles and Templates](/dotnet/framework/wpf/controls/datepicker-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [DatePicker Styles and Templates](/dotnet/framework/wpf/controls/datepicker-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/DocumentViewer.xml b/xml/System.Windows.Controls/DocumentViewer.xml index e609ea0fbe5..1d1991fd023 100644 --- a/xml/System.Windows.Controls/DocumentViewer.xml +++ b/xml/System.Windows.Controls/DocumentViewer.xml @@ -39,7 +39,7 @@ ## Remarks ## Customizing the DocumentViewer Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [DocumentViewer Styles and Templates](/dotnet/framework/wpf/controls/documentviewer-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [DocumentViewer Styles and Templates](/dotnet/framework/wpf/controls/documentviewer-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/Expander.xml b/xml/System.Windows.Controls/Expander.xml index 3196c520b6c..2deb416e613 100644 --- a/xml/System.Windows.Controls/Expander.xml +++ b/xml/System.Windows.Controls/Expander.xml @@ -48,7 +48,7 @@ The alignment of content can be defined by setting the and properties on the control. These properties are applied to the header and to the contents of the expanded window. ## Customizing the Expander Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Expander Styles and Templates](/dotnet/framework/wpf/controls/expander-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Expander Styles and Templates](/dotnet/framework/wpf/controls/expander-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/Frame.xml b/xml/System.Windows.Controls/Frame.xml index 4b437bdce46..024108666a5 100644 --- a/xml/System.Windows.Controls/Frame.xml +++ b/xml/System.Windows.Controls/Frame.xml @@ -112,7 +112,7 @@ Using , you can also remember multiple sets of state for a single page instance. ## Customizing the Frame Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Frame Styles and Templates](/dotnet/framework/wpf/controls/frame-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Frame Styles and Templates](/dotnet/framework/wpf/controls/frame-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/GroupBox.xml b/xml/System.Windows.Controls/GroupBox.xml index c15531dc25b..520f077819c 100644 --- a/xml/System.Windows.Controls/GroupBox.xml +++ b/xml/System.Windows.Controls/GroupBox.xml @@ -30,29 +30,29 @@ Represents a control that creates a container that has a border and a header for user interface (UI) content. - is a , which means its and properties can be of any type (such as string, image, or panel). For more information, see the class. - - The following illustration is an example of a that contains a and a that are enclosed in a . - - ![GroupBoxImage](~/add/media/groupboximage.JPG "GroupBoxImage") - -## Customizing the GroupBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [GroupBox Styles and Templates](/dotnet/framework/wpf/controls/groupbox-styles-and-templates). - + is a , which means its and properties can be of any type (such as string, image, or panel). For more information, see the class. + + The following illustration is an example of a that contains a and a that are enclosed in a . + + ![GroupBoxImage](~/add/media/groupboximage.JPG "GroupBoxImage") + +## Customizing the GroupBox Control + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [GroupBox Styles and Templates](/dotnet/framework/wpf/controls/groupbox-styles-and-templates). + Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. - -[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] - -## Examples - The following example defines a control that is titled **Employee Data**. The control encloses a and a in a . The example sets the property to a . - - :::code language="xaml" source="~/snippets/csharp/System.Windows/FrameworkElement/IsLoaded/Page1.xaml" id="Snippet1"::: - - You must also define an event handler on a code-behind page in order to handle the event that occurs when a user clicks the **Show Summary** button. - + +[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] + +## Examples + The following example defines a control that is titled **Employee Data**. The control encloses a and a in a . The example sets the property to a . + + :::code language="xaml" source="~/snippets/csharp/System.Windows/FrameworkElement/IsLoaded/Page1.xaml" id="Snippet1"::: + + You must also define an event handler on a code-behind page in order to handle the event that occurs when a user clicks the **Show Summary** button. + ]]> diff --git a/xml/System.Windows.Controls/Label.xml b/xml/System.Windows.Controls/Label.xml index 6e2ba8fca4f..44c605d7a4a 100644 --- a/xml/System.Windows.Controls/Label.xml +++ b/xml/System.Windows.Controls/Label.xml @@ -48,7 +48,7 @@ A is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. ## Customizing the Label Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Label Styles and Templates](/dotnet/framework/wpf/controls/label-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Label Styles and Templates](/dotnet/framework/wpf/controls/label-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ListBox.xml b/xml/System.Windows.Controls/ListBox.xml index f39004f6858..d3fb1cc3747 100644 --- a/xml/System.Windows.Controls/ListBox.xml +++ b/xml/System.Windows.Controls/ListBox.xml @@ -54,7 +54,7 @@ Displaying a large number of items may cause performance issues. See [Optimizing Performance: Controls](/dotnet/framework/wpf/advanced/optimizing-performance-controls) for more information. ## Customizing the ListBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ListBox Styles and Templates](/dotnet/framework/wpf/controls/listbox-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ListBox Styles and Templates](/dotnet/framework/wpf/controls/listbox-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ListBoxItem.xml b/xml/System.Windows.Controls/ListBoxItem.xml index b7197a5ed54..790748ebb59 100644 --- a/xml/System.Windows.Controls/ListBoxItem.xml +++ b/xml/System.Windows.Controls/ListBoxItem.xml @@ -42,7 +42,7 @@ A is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. ## Customizing the ListBoxItem Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ListBox Styles and Templates](/dotnet/framework/wpf/controls/listbox-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ListBox Styles and Templates](/dotnet/framework/wpf/controls/listbox-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ListView.xml b/xml/System.Windows.Controls/ListView.xml index 79a253d67b2..192f8db3c62 100644 --- a/xml/System.Windows.Controls/ListView.xml +++ b/xml/System.Windows.Controls/ListView.xml @@ -54,7 +54,7 @@ Displaying a large number of items may cause performance issues. See [Optimizing Performance: Controls](/dotnet/framework/wpf/advanced/optimizing-performance-controls) for more information. ## Customizing the ListView Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ListView Styles and Templates](/dotnet/framework/wpf/controls/listview-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ListView Styles and Templates](/dotnet/framework/wpf/controls/listview-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ListViewItem.xml b/xml/System.Windows.Controls/ListViewItem.xml index 8880611c7c1..e9ab1359983 100644 --- a/xml/System.Windows.Controls/ListViewItem.xml +++ b/xml/System.Windows.Controls/ListViewItem.xml @@ -23,22 +23,22 @@ Represents an item in a control. - is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. - + is a , which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the class. + A typically specifies the content for its controls by setting the property or the property. - - Templates and styles that are defined for the type are used to specify the display of the content in a . - -## Customizing the ListViewItem Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ListView Styles and Templates](/dotnet/framework/wpf/controls/listview-styles-and-templates). - + + Templates and styles that are defined for the type are used to specify the display of the content in a . + +## Customizing the ListViewItem Control + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ListView Styles and Templates](/dotnet/framework/wpf/controls/listview-styles-and-templates). + Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. - -[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] - + +[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] + ]]> diff --git a/xml/System.Windows.Controls/Menu.xml b/xml/System.Windows.Controls/Menu.xml index 20fdc64465a..be1e5b7c2fd 100644 --- a/xml/System.Windows.Controls/Menu.xml +++ b/xml/System.Windows.Controls/Menu.xml @@ -32,7 +32,7 @@ is an , which means it can contain a collection of objects of any type (such as string, image, or panel). For more information, see the class. The is the most common type of item in a . A can contain child items. The child items will appear in a submenu when the user chooses a parent . ## Customizing the Menu Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Menu Styles and Templates](/dotnet/framework/wpf/controls/menu-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Menu Styles and Templates](/dotnet/framework/wpf/controls/menu-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/MenuItem.xml b/xml/System.Windows.Controls/MenuItem.xml index ebe9c31b46b..c734a9dd0e7 100644 --- a/xml/System.Windows.Controls/MenuItem.xml +++ b/xml/System.Windows.Controls/MenuItem.xml @@ -69,7 +69,7 @@ The handles the event, so if you attach an event handler to , your handler will never be called. To add your own handler, subscribe to the event or subscribe to by calling with `handledEventsToo` set to `true`. ## Customizing the MenuItem Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Menu Styles and Templates](/dotnet/framework/wpf/controls/menu-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Menu Styles and Templates](/dotnet/framework/wpf/controls/menu-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/PasswordBox.xml b/xml/System.Windows.Controls/PasswordBox.xml index dda15fb9f49..3e4ab900d15 100644 --- a/xml/System.Windows.Controls/PasswordBox.xml +++ b/xml/System.Windows.Controls/PasswordBox.xml @@ -38,7 +38,7 @@ > has built-in handling for the bubbling and events. Consequently, custom event handlers that listen for `MouseUp` or `MouseDown` events from a `PasswordBox` will never be called. If you need to respond to these events, listen for the tunneling and events instead, or register the handlers with the argument (this latter option is only available through code). Do not mark the event handled unless you deliberately want to disable native handling of these events, and be aware that this has notable effects on the control's UI. ## Customizing the PasswordBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [PasswordBox Styles and Templates](/dotnet/framework/wpf/controls/passwordbox-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [PasswordBox Styles and Templates](/dotnet/framework/wpf/controls/passwordbox-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ProgressBar.xml b/xml/System.Windows.Controls/ProgressBar.xml index 4f360390594..f425670687e 100644 --- a/xml/System.Windows.Controls/ProgressBar.xml +++ b/xml/System.Windows.Controls/ProgressBar.xml @@ -46,7 +46,7 @@ overrides the metadata of the property and sets its default to 100. overrides the metadata of the property and sets its default to `false`. For more information, see [Dependency Properties Overview](/dotnet/framework/wpf/advanced/dependency-properties-overview). ## Customizing the ProgressBar Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ProgressBar Styles and Templates](/dotnet/framework/wpf/controls/progressbar-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ProgressBar Styles and Templates](/dotnet/framework/wpf/controls/progressbar-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/RadioButton.xml b/xml/System.Windows.Controls/RadioButton.xml index e4476389860..20b0c34ff19 100644 --- a/xml/System.Windows.Controls/RadioButton.xml +++ b/xml/System.Windows.Controls/RadioButton.xml @@ -40,7 +40,7 @@ When a is selected, it cannot be cleared by clicking it. When elements are grouped, the buttons are mutually exclusive. A user can select only one item at a time within a group. You can group controls by placing them inside a parent or by setting the property on each . ## Customizing the RadioButton Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [RadioButton Styles and Templates](/dotnet/framework/wpf/controls/radiobutton-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [RadioButton Styles and Templates](/dotnet/framework/wpf/controls/radiobutton-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ScrollViewer.xml b/xml/System.Windows.Controls/ScrollViewer.xml index acdb801a142..210e78d5a2b 100644 --- a/xml/System.Windows.Controls/ScrollViewer.xml +++ b/xml/System.Windows.Controls/ScrollViewer.xml @@ -58,7 +58,7 @@ Because the scroll bars for a element are defined in the default style of the element, scroll bars will no longer appear if you apply a custom style to a . Scroll bars must be defined in the custom style for them to appear. ## Customizing the ScrollViewer Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ScrollViewer Styles and Templates](/dotnet/framework/wpf/controls/scrollviewer-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ScrollViewer Styles and Templates](/dotnet/framework/wpf/controls/scrollviewer-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/Slider.xml b/xml/System.Windows.Controls/Slider.xml index ede18f92701..156ceb45efc 100644 --- a/xml/System.Windows.Controls/Slider.xml +++ b/xml/System.Windows.Controls/Slider.xml @@ -75,7 +75,7 @@ > If the value of the is animated, the user may no longer be able to interact with the control after the animation finishes. See [How to: Set a Property After Animating It with a Storyboard](/dotnet/framework/wpf/graphics-multimedia/how-to-set-a-property-after-animating-it-with-a-storyboard) for options of how you can restore user control of a after it is animated. ## Customizing the Slider Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Slider Styles and Templates](/dotnet/framework/wpf/controls/slider-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Slider Styles and Templates](/dotnet/framework/wpf/controls/slider-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/TabControl.xml b/xml/System.Windows.Controls/TabControl.xml index 626290d1fdc..aadf224cf88 100644 --- a/xml/System.Windows.Controls/TabControl.xml +++ b/xml/System.Windows.Controls/TabControl.xml @@ -42,7 +42,7 @@ is an , which means it can contain a collection of objects of any type (such as string, image, or panel). For more information, see the class. ## Customizing the TabControl Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [TabControl Styles and Templates](/dotnet/framework/wpf/controls/tabcontrol-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [TabControl Styles and Templates](/dotnet/framework/wpf/controls/tabcontrol-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/TabItem.xml b/xml/System.Windows.Controls/TabItem.xml index 3041ae76767..e0f87f572d5 100644 --- a/xml/System.Windows.Controls/TabItem.xml +++ b/xml/System.Windows.Controls/TabItem.xml @@ -36,7 +36,7 @@ is a . Its content property is and its header property is . For more information, see the class. ## Customizing the TabControl Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [TabControl Styles and Templates](/dotnet/framework/wpf/controls/tabcontrol-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [TabControl Styles and Templates](/dotnet/framework/wpf/controls/tabcontrol-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/TextBox.xml b/xml/System.Windows.Controls/TextBox.xml index f02ccb28343..e0f645264f8 100644 --- a/xml/System.Windows.Controls/TextBox.xml +++ b/xml/System.Windows.Controls/TextBox.xml @@ -62,7 +62,7 @@ Example of a TextBox Usually the event should be used to detect whenever the text in a or changes rather then as you might expect. See [How to: Detect When Text in a TextBox Has Changed](/dotnet/framework/wpf/controls/how-to-detect-when-text-in-a-textbox-has-changed) for an example. ## Customizing the TextBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [TextBox Styles and Templates](/dotnet/framework/wpf/controls/textbox-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [TextBox Styles and Templates](/dotnet/framework/wpf/controls/textbox-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ToolBar.xml b/xml/System.Windows.Controls/ToolBar.xml index 5db5e5466b8..347580b15a0 100644 --- a/xml/System.Windows.Controls/ToolBar.xml +++ b/xml/System.Windows.Controls/ToolBar.xml @@ -42,7 +42,7 @@ is a , which means its header and collection of objects can be of any type (such as string, image, or panel). For more information, see the class. ## Customizing the ToolBar Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ToolBar Styles and Templates](/dotnet/framework/wpf/controls/toolbar-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ToolBar Styles and Templates](/dotnet/framework/wpf/controls/toolbar-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/ToolTip.xml b/xml/System.Windows.Controls/ToolTip.xml index d44ef37d1ec..dce92b97687 100644 --- a/xml/System.Windows.Controls/ToolTip.xml +++ b/xml/System.Windows.Controls/ToolTip.xml @@ -48,7 +48,7 @@ The properties of the class are used to define the position and behavior of the tooltip. Many of these properties are also defined in the class. If the value of one of these properties is specified by both the property and the attached property, the value of the property is used. In addition, the class provides properties to set timing behavior. These attached properties are not included in the class but can be used by the control. ## Customizing the ToolTip Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [ToolTip Styles and Templates](/dotnet/framework/wpf/controls/tooltip-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [ToolTip Styles and Templates](/dotnet/framework/wpf/controls/tooltip-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/TreeView.xml b/xml/System.Windows.Controls/TreeView.xml index 335cbb902af..f71938bb613 100644 --- a/xml/System.Windows.Controls/TreeView.xml +++ b/xml/System.Windows.Controls/TreeView.xml @@ -50,7 +50,7 @@ A has a limited number of levels. For more information, see . ## Customizing the TreeView Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [TreeView Styles and Templates](/dotnet/framework/wpf/controls/treeview-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [TreeView Styles and Templates](/dotnet/framework/wpf/controls/treeview-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Controls/TreeViewItem.xml b/xml/System.Windows.Controls/TreeViewItem.xml index 554120b1fbe..cf323d3c8e5 100644 --- a/xml/System.Windows.Controls/TreeViewItem.xml +++ b/xml/System.Windows.Controls/TreeViewItem.xml @@ -63,7 +63,7 @@ For more information about the control, see the [TreeView Overview](/dotnet/framework/wpf/controls/treeview-overview). ## Customizing the TreeViewItem Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [TreeView Styles and Templates](/dotnet/framework/wpf/controls/treeview-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [TreeView Styles and Templates](/dotnet/framework/wpf/controls/treeview-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows.Navigation/NavigationWindow.xml b/xml/System.Windows.Navigation/NavigationWindow.xml index ba14a7f9f0b..6822629d4df 100644 --- a/xml/System.Windows.Navigation/NavigationWindow.xml +++ b/xml/System.Windows.Navigation/NavigationWindow.xml @@ -106,7 +106,7 @@ **Content Model:** is a , which means that can contain content such as text, images, or panels. Also, is a root element and, consequently, cannot be part of another element's content. For more information about the content model for , see [WPF Content Model](/dotnet/framework/wpf/controls/wpf-content-model). ## Customizing the NavigationWindow Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [NavigationWindow Styles and Templates](/dotnet/framework/wpf/controls/navigationwindow-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [NavigationWindow Styles and Templates](/dotnet/framework/wpf/controls/navigationwindow-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. diff --git a/xml/System.Windows/VisualState.xml b/xml/System.Windows/VisualState.xml index 6251af49f07..2a100be33ea 100644 --- a/xml/System.Windows/VisualState.xml +++ b/xml/System.Windows/VisualState.xml @@ -32,20 +32,20 @@ Represents the visual appearance of the control when it is in a specific state. - specifies how the control looks when it is in a certain state. For example, when a is pressed, its border might be a different color than normal. The class has a property that changes the appearance of the control. When the control enters the state that is specified by the property, the begins. When the control exits the state, the stops. - - The property contains objects. objects are added to the attached property, which is defined on the on a . You can add objects to any , but they are typically are used in a of a . For information about how to create a and objects for existing controls, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). For an example of using objects outside of a , see the class. - - - -## Examples - The following example creates a in the of a called `CommonStates` and adds objects for the states, `Normal`, `Pressed`, and `MouseOver`. The also defines a state called `Disabled` that is in the `CommonStates` , but the example omits it for brevity. For the entire example, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/buttonstages.xaml" id="Snippet10"::: - + specifies how the control looks when it is in a certain state. For example, when a is pressed, its border might be a different color than normal. The class has a property that changes the appearance of the control. When the control enters the state that is specified by the property, the begins. When the control exits the state, the stops. + + The property contains objects. objects are added to the attached property, which is defined on the on a . You can add objects to any , but they are typically are used in a of a . For information about how to create a and objects for existing controls, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). For an example of using objects outside of a , see the class. + + + +## Examples + The following example creates a in the of a called `CommonStates` and adds objects for the states, `Normal`, `Pressed`, and `MouseOver`. The also defines a state called `Disabled` that is in the `CommonStates` , but the example omits it for brevity. For the entire example, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/buttonstages.xaml" id="Snippet10"::: + ]]> @@ -114,22 +114,22 @@ Gets or sets the name of the . The name of the . - of the to the . - - When a uses the in a , the control author should specify which objects the control expects to find in its by putting the on its class signature. authors define new objects and set the property to the value specified by the property. - - To find the names of the visual states for the controls that are included with WPF, see [Control Styles and Templates](/dotnet/framework/wpf/controls/control-styles-and-templates). For information about how to create a and objects for existing controls, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - - -## Examples - The following example creates a in the of a called `CommonStates` and adds objects for the states, `Normal`, `Pressed`, and `MouseOver`. The also defines a state called `Disabled` that is in the `CommonStates` , but the example omits it for brevity. For the entire example, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/buttonstages.xaml" id="Snippet10"::: - + of the to the . + + When a uses the in a , the control author should specify which objects the control expects to find in its by putting the on its class signature. authors define new objects and set the property to the value specified by the property. + + To find the names of the visual states for the controls that are included with WPF, see [Control Styles and Templates](/dotnet/framework/wpf/controls/control-styles-and-templates). For information about how to create a and objects for existing controls, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + + +## Examples + The following example creates a in the of a called `CommonStates` and adds objects for the states, `Normal`, `Pressed`, and `MouseOver`. The also defines a state called `Disabled` that is in the `CommonStates` , but the example omits it for brevity. For the entire example, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/buttonstages.xaml" id="Snippet10"::: + ]]> @@ -159,18 +159,18 @@ Gets or sets a that defines the appearance of the control when it is in the state that is represented by the . A storyboard that defines the appearance of the control when it is in the state that is represented by the . The default is . - property, the begins. When the control exits the state, the stops. - - - -## Examples - The following example creates a simple for a that contains one . The called `MouseOver` has a Storyboard that changes the color of the from green to red when the user puts the mouse over the . The called `Normal` is included so that when the user moves the mouse off the button, the returns to green. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: - + property, the begins. When the control exits the state, the stops. + + + +## Examples + The following example creates a simple for a that contains one . The called `MouseOver` has a Storyboard that changes the color of the from green to red when the user puts the mouse over the . The called `Normal` is included so that when the user moves the mouse off the button, the returns to green. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: + ]]> diff --git a/xml/System.Windows/VisualStateGroup.xml b/xml/System.Windows/VisualStateGroup.xml index bdb4036f8a6..22742c587b0 100644 --- a/xml/System.Windows/VisualStateGroup.xml +++ b/xml/System.Windows/VisualStateGroup.xml @@ -32,26 +32,26 @@ Contains mutually exclusive objects and objects that are used to move from one state to another. - contains a collection of objects. A contains a collection of objects that specify how the control's appearance changes when the control is in a certain state. For example, a might have a slightly different appearance when it is pressed than when it is not pressed. Two states that the defines correspond to when it is pressed (`"Pressed"`) and when it is not (`"Normal"`). - - You add to a control by setting the `VisualStateManager.VisualStateGroups` attached property on the control. You put states that are mutually exclusive to each other in the same . For example, the has two objects. One contains the states, `Normal`, `MouseOver`, `Pressed`, and `Disabled`. The other contains the states, `Checked`, `UnChecked`, and `Indeterminate`. The can be in states `MouseOver` and `UnChecked` at the same time, but it cannot be in the `MouseOver` and `Pressed` states at the same time. - - Although you can add objects to any element, they are a particularly useful way to enable others to redefine the visual behavior of a . If you create a custom control that uses a , you can specify which states that control can be in by adding a on its class definition. Then anyone who creates a new for your control can add objects to the template. The enables designer tools, such as Visual Studio and Blend for Visual Studio, to expose the control's states. States with the same belong in the same . - - For more information about how to use objects in a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). For more information about how to create controls that use the , see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). - - The property contains objects that are applied when the control transition between states that are defined in the . - - - -## Examples - The following example creates a simple for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: - + contains a collection of objects. A contains a collection of objects that specify how the control's appearance changes when the control is in a certain state. For example, a might have a slightly different appearance when it is pressed than when it is not pressed. Two states that the defines correspond to when it is pressed (`"Pressed"`) and when it is not (`"Normal"`). + + You add to a control by setting the `VisualStateManager.VisualStateGroups` attached property on the control. You put states that are mutually exclusive to each other in the same . For example, the has two objects. One contains the states, `Normal`, `MouseOver`, `Pressed`, and `Disabled`. The other contains the states, `Checked`, `UnChecked`, and `Indeterminate`. The can be in states `MouseOver` and `UnChecked` at the same time, but it cannot be in the `MouseOver` and `Pressed` states at the same time. + + Although you can add objects to any element, they are a particularly useful way to enable others to redefine the visual behavior of a . If you create a custom control that uses a , you can specify which states that control can be in by adding a on its class definition. Then anyone who creates a new for your control can add objects to the template. The enables designer tools, such as Visual Studio and Blend for Visual Studio, to expose the control's states. States with the same belong in the same . + + For more information about how to use objects in a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). For more information about how to create controls that use the , see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). + + The property contains objects that are applied when the control transition between states that are defined in the . + + + +## Examples + The following example creates a simple for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: + ]]> @@ -147,11 +147,11 @@ Occurs after a control transitions to a different state. - event occurs. - + event occurs. + ]]> @@ -181,11 +181,11 @@ Occurs when a control starts transitioning to a different state. - is applied to the state change, this event occurs when the transition begins. If a is not applied, this event occurs after the control transitions to the new state, but before the event. - + is applied to the state change, this event occurs when the transition begins. If a is not applied, this event occurs after the control transitions to the new state, but before the event. + ]]> @@ -225,18 +225,18 @@ Gets or sets the name of the . The name of the . - on its class definition. States with the same belong in the same . Set the of the to the value of the property. - - - -## Examples - The following example creates two objects that are named `CommonStates` and `FocusStates`. The control will be in exactly one state from each at all times. For the entire example, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet5"::: - + on its class definition. States with the same belong in the same . Set the of the to the value of the property. + + + +## Examples + The following example creates two objects that are named `CommonStates` and `FocusStates`. The control will be in exactly one state from each at all times. For the entire example, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet5"::: + ]]> @@ -266,13 +266,13 @@ Gets the collection of mutually exclusive objects. The collection of mutually exclusive objects. - for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: - + for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: + ]]> @@ -302,18 +302,18 @@ Gets the collection of objects. The collection of objects. - objects in are applied when the control transition between states that are defined in the . - - - -## Examples - The following example creates a simple for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: - + objects in are applied when the control transition between states that are defined in the . + + + +## Examples + The following example creates a simple for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: + ]]> diff --git a/xml/System.Windows/VisualStateManager.xml b/xml/System.Windows/VisualStateManager.xml index 150f78523fa..c84d952bde5 100644 --- a/xml/System.Windows/VisualStateManager.xml +++ b/xml/System.Windows/VisualStateManager.xml @@ -22,29 +22,29 @@ Manages states and the logic for transitioning between states for controls. - enables you to specify states for a control, the appearance of a control when it is in a certain state, and when a control changes states. For example, a might have a slightly different appearance when it is pressed than when it is not pressed. Two states that the defines correspond to when it is pressed (`"Pressed"`) and when it is not (`"Normal"`). The appearance of a control when it is in a state is defined by a . A contains a collection of objects that specify how the control's appearance changes when the control is in that state. You add visual states to a control by setting the `VisualStateManager.VisualStateGroups` attached property on the control. Each contains a collection of objects that are mutually exclusive. That is, the control is always in exactly one state of in each . - - The also enables you to specify when a control enters a specific state. The method that you should call to change states depends on your scenario. If you create a control that uses the in its , call the method. For more information about how to create controls that use the , see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). If you use the outside of a (for example, if you use a in a or in a single element), call the method. In either case, the performs the logic that is required to appropriately start and stop the storyboards that are associated with the involved state. For example, suppose that a control defines the states, `State1` and `State2`, each of which has a storyboard associated with it. If the control is in `State1` and you pass `State2` to or , the starts the storyboard in `State2` and stops the storyboard in `State1`. - - Controls that are included with Windows Presentation Foundation (WPF) use the to change visual states. When you create a for a control that is included with WPF, you can add objects to the control's to specify the control's appearance in a certain state. To find the names of the visual states for the controls that are included with WPF, see [Control Styles and Templates](/dotnet/framework/wpf/controls/control-styles-and-templates). The control's logic handles transitioning between states, so you do not need to do anything other than define the objects in the new . For more information about how to create control templates for existing controls, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - If you want to implement your own logic for transitioning between states, you must inherit from , override the method, and set the attached property on the control that uses the custom logic. - - - -## Examples - The following example creates a and adds a named `CommonStates` to the `VisualStateManager.VisualStatesGroups` attached property. The example defines the `MouseOver` and `Normal` objects in the `CommonStates` . When the user moves the mouse pointer over the , it changes from red to green over one half second. When the user moves the mouse away from the rectangle, the immediately changes back to red. Note that the `Normal` state does not define a . A is not required because when the transitions from the `MouseOver` state to the `Normal` state, the for `MouseOver` is stopped and the property for the returns to red. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/window1.xaml" id="Snippetvsmnotemplate"::: - - The following example shows the event handler that is defined in the previous example and calls the method to transition between states. If the rectangle in the previous example was part of a , the example would have to call the method. - + enables you to specify states for a control, the appearance of a control when it is in a certain state, and when a control changes states. For example, a might have a slightly different appearance when it is pressed than when it is not pressed. Two states that the defines correspond to when it is pressed (`"Pressed"`) and when it is not (`"Normal"`). The appearance of a control when it is in a state is defined by a . A contains a collection of objects that specify how the control's appearance changes when the control is in that state. You add visual states to a control by setting the `VisualStateManager.VisualStateGroups` attached property on the control. Each contains a collection of objects that are mutually exclusive. That is, the control is always in exactly one state of in each . + + The also enables you to specify when a control enters a specific state. The method that you should call to change states depends on your scenario. If you create a control that uses the in its , call the method. For more information about how to create controls that use the , see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). If you use the outside of a (for example, if you use a in a or in a single element), call the method. In either case, the performs the logic that is required to appropriately start and stop the storyboards that are associated with the involved state. For example, suppose that a control defines the states, `State1` and `State2`, each of which has a storyboard associated with it. If the control is in `State1` and you pass `State2` to or , the starts the storyboard in `State2` and stops the storyboard in `State1`. + + Controls that are included with Windows Presentation Foundation (WPF) use the to change visual states. When you create a for a control that is included with WPF, you can add objects to the control's to specify the control's appearance in a certain state. To find the names of the visual states for the controls that are included with WPF, see [Control Styles and Templates](/dotnet/framework/wpf/controls/control-styles-and-templates). The control's logic handles transitioning between states, so you do not need to do anything other than define the objects in the new . For more information about how to create control templates for existing controls, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + If you want to implement your own logic for transitioning between states, you must inherit from , override the method, and set the attached property on the control that uses the custom logic. + + + +## Examples + The following example creates a and adds a named `CommonStates` to the `VisualStateManager.VisualStatesGroups` attached property. The example defines the `MouseOver` and `Normal` objects in the `CommonStates` . When the user moves the mouse pointer over the , it changes from red to green over one half second. When the user moves the mouse away from the rectangle, the immediately changes back to red. Note that the `Normal` state does not define a . A is not required because when the transitions from the `MouseOver` state to the `Normal` state, the for `MouseOver` is stopped and the property for the returns to red. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/window1.xaml" id="Snippetvsmnotemplate"::: + + The following example shows the event handler that is defined in the previous example and calls the method to transition between states. If the rectangle in the previous example was part of a , the example would have to call the method. + :::code language="csharp" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/window1.xaml.cs" id="Snippetgotoelementstate"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmcustomcontrol/visualbasic/window1.xaml.vb" id="Snippetgotoelementstate"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmcustomcontrol/visualbasic/window1.xaml.vb" id="Snippetgotoelementstate"::: + ]]> @@ -98,11 +98,11 @@ Gets or sets the object that transitions between the states of a control. - is `null`, the uses its own logic to transition between states. If you want to implement your own logic for transitioning between states, create a class that inherits from and override the method. To use the custom class, set the property to an object of your custom type. - + is `null`, the uses its own logic to transition between states. If you want to implement your own logic for transitioning between states, create a class that inherits from and override the method. To use the custom class, set the property to an object of your custom type. + ]]> @@ -240,30 +240,30 @@ if the control successfully transitioned to the new state; otherwise, . - method to change states on an element outside of a (for example, if you use a in a or ). Call the method if you are changing states in a control that uses the in its . - - - -## Examples - The following example creates an application that prompts the user to guess a number between 1 and 100. When the user enters a number, the application indicates whether the guess is too high, too low, or correct. The following XAML creates the user interface for the application and defines 4 states: `TooLow`, `TooHigh`, `Correct`, and `Guessing`. When the application begins, it is in the `Guessing` state. . - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualStateManager/GoToElementState/mainwindow.xaml" id="Snippetgotoelementstatexaml"::: - - The following code shows the logic of the application. When the user enters a number and clicks the button, the application calls to transition to `TooHigh`, `TooLow`, or `Correct` to provide feedback to the user about the guess. To try this example, call the `GenerateNumber` method when the application begins. - + method to change states on an element outside of a (for example, if you use a in a or ). Call the method if you are changing states in a control that uses the in its . + + + +## Examples + The following example creates an application that prompts the user to guess a number between 1 and 100. When the user enters a number, the application indicates whether the guess is too high, too low, or correct. The following XAML creates the user interface for the application and defines 4 states: `TooLow`, `TooHigh`, `Correct`, and `Guessing`. When the application begins, it is in the `Guessing` state. . + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualStateManager/GoToElementState/mainwindow.xaml" id="Snippetgotoelementstatexaml"::: + + The following code shows the logic of the application. When the user enters a number and clicks the button, the application calls to transition to `TooHigh`, `TooLow`, or `Correct` to provide feedback to the user about the guess. To try this example, call the `GenerateNumber` method when the application begins. + :::code language="csharp" source="~/snippets/csharp/System.Windows/VisualStateManager/GoToElementState/mainwindow.xaml.cs" id="Snippetgotoelementstatecode"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmgotoelementstate/visualbasic/mainwindow.xaml.vb" id="Snippetgotoelementstatecode"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmgotoelementstate/visualbasic/mainwindow.xaml.vb" id="Snippetgotoelementstatecode"::: + ]]> - is . - - -or- - + is . + + -or- + is . @@ -302,26 +302,26 @@ if the control successfully transitioned to the new state; otherwise, . - method if you are changing states in a control that uses the in its . Call the method to change states on an element outside of a (for example, if you use a in a or in a single element). - - - -## Examples - The following example demonstrates a control that uses the method to transition between states. For the entire example, see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). - + method if you are changing states in a control that uses the in its . Call the method to change states on an element outside of a (for example, if you use a in a or in a single element). + + + +## Examples + The following example demonstrates a control that uses the method to transition between states. For the entire example, see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). + :::code language="csharp" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/numericupdown.cs" id="Snippetupdatestates"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmcustomcontrol/visualbasic/numericupdown.vb" id="Snippetupdatestates"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmcustomcontrol/visualbasic/numericupdown.vb" id="Snippetupdatestates"::: + ]]> - is . - - -or- - + is . + + -or- + is . @@ -372,19 +372,19 @@ if the control successfully transitioned to the new state; otherwise, . - method performs the logic necessary to appropriately start and stop the storyboards that are associated with a transition. When a control calls to change its state, the does the following: - -- First, if the that the control is transitioning to has a , the storyboard begins. Then, if the that the control is coming from has a , the storyboard ends. - -- If the control is already in the `stateName` state, takes no action and returns `true`. - -- If `stateName` does not exist in the of `control`, takes no action and returns `false`. - - You can implement your own to provide different logic for transitioning between states. For example, you can change the logic described previously, or you can provide logic to transition between custom animation types. To implement a , create a class that inherits from and override the method. To use the custom class, set the property to an object of your custom type. - + method performs the logic necessary to appropriately start and stop the storyboards that are associated with a transition. When a control calls to change its state, the does the following: + +- First, if the that the control is transitioning to has a , the storyboard begins. Then, if the that the control is coming from has a , the storyboard ends. + +- If the control is already in the `stateName` state, takes no action and returns `true`. + +- If `stateName` does not exist in the of `control`, takes no action and returns `false`. + + You can implement your own to provide different logic for transitioning between states. For example, you can change the logic described previously, or you can provide logic to transition between custom animation types. To implement a , create a class that inherits from and override the method. To use the custom class, set the property to an object of your custom type. + ]]> @@ -425,18 +425,18 @@ The root element that contains the . Raises the event on the specified object. - is set on the of a control, the `control` parameter is set to the control that owns . When the is set on a , `control` is `null` and you should use the `stateGroupsRoot` parameter. - + is set on the of a control, the `control` parameter is set to the control that owns . When the is set on a , `control` is `null` and you should use the `stateGroupsRoot` parameter. + ]]> - is . - - -or- - + is . + + -or- + is . When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. @@ -479,18 +479,18 @@ The root element that contains the . Raises the event on the specified object. - is set on the of a control, the `control` parameter is set to the control that owns . When the is set on a , `control` is `null` and you should use the `stateGroupsRoot` parameter. - + is set on the of a control, the `control` parameter is set to the control that owns . When the is set on a , `control` is `null` and you should use the `stateGroupsRoot` parameter. + ]]> - is . - - -or- - + is . + + -or- + is . When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. @@ -550,19 +550,19 @@ Gets or sets a collection of objects. contains a collection of objects. A contains a collection of objects that specify how the control's appearance changes when the control is in a certain state. For example, a might have a slightly different appearance when it is pressed than when it is not pressed. Two states that the defines correspond to when it is pressed (`"Pressed"`) and when it is not (`"Normal"`). - - You add to a control by setting the attached property on the control. You put states that are mutually exclusive to each other in the same . For example, the has two objects. One contains the states, `Normal`, `MouseOver`, `Pressed`, and `Disabled`. The other contains the states, `Checked`, `UnChecked`, and `Indeterminate`. The can be in states `MouseOver` and `UnChecked` at the same time, but it cannot be in the `MouseOver` and `Pressed` states at the same time. - - Although you can add objects to any element, they are a particularly useful way to enable others to redefine the visual behavior of a . If you create a custom control that uses a , you can specify which states that control can be in by adding a on its class definition. Then anyone who creates a new for your control can add objects to the template. States with the same belong in the same . - - For more information about how to use objects in a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). For more information about how to create controls that use the , see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). - -## Examples - The following example creates a simple for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . - + +## Remarks + Each contains a collection of objects. A contains a collection of objects that specify how the control's appearance changes when the control is in a certain state. For example, a might have a slightly different appearance when it is pressed than when it is not pressed. Two states that the defines correspond to when it is pressed (`"Pressed"`) and when it is not (`"Normal"`). + + You add to a control by setting the attached property on the control. You put states that are mutually exclusive to each other in the same . For example, the has two objects. One contains the states, `Normal`, `MouseOver`, `Pressed`, and `Disabled`. The other contains the states, `Checked`, `UnChecked`, and `Indeterminate`. The can be in states `MouseOver` and `UnChecked` at the same time, but it cannot be in the `MouseOver` and `Pressed` states at the same time. + + Although you can add objects to any element, they are a particularly useful way to enable others to redefine the visual behavior of a . If you create a custom control that uses a , you can specify which states that control can be in by adding a on its class definition. Then anyone who creates a new for your control can add objects to the template. States with the same belong in the same . + + For more information about how to use objects in a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). For more information about how to create controls that use the , see [Creating a Control That Has a Customizable Appearance](/dotnet/framework/wpf/controls/creating-a-control-that-has-a-customizable-appearance). + +## Examples + The following example creates a simple for a that contains one . It also contains a named `CommonStates`, which defines the `MouseOver` and `Normal` states. The also has a that specifies that it takes one half second for the to change from green to red when the user moves the mouse pointer over the . + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/window1.xaml" id="Snippet11"::: ]]> diff --git a/xml/System.Windows/VisualTransition.xml b/xml/System.Windows/VisualTransition.xml index 6b6e6c87023..310bc3f21dd 100644 --- a/xml/System.Windows/VisualTransition.xml +++ b/xml/System.Windows/VisualTransition.xml @@ -28,24 +28,24 @@ Represents the visual behavior that occurs when a control transitions from one state to another. - objects. When you create a , you specify one or more of the following: - -- The time it takes for a transition between states to occur by setting the property. - -- Additional changes in the control's appearance that occur at the time of the transition by setting the property. - -- When the is applied by setting the and properties. - - - -## Examples - The following example creates a that specifies that when the user moves the mouse away from the control, the control's border changes to blue, then to yellow, and then to black in 1.5 seconds. For the entire example, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet8"::: - + objects. When you create a , you specify one or more of the following: + +- The time it takes for a transition between states to occur by setting the property. + +- Additional changes in the control's appearance that occur at the time of the transition by setting the property. + +- When the is applied by setting the and properties. + + + +## Examples + The following example creates a that specifies that when the user moves the mouse away from the control, the control's border changes to blue, then to yellow, and then to black in 1.5 seconds. For the entire example, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet8"::: + ]]> @@ -108,29 +108,29 @@ Gets or sets the name of the to transition from. The name of the to transition from. - property is optional. A can be restricted to apply to only certain states or it can be applied any time the control transitions between states. You restrict when a is applied by setting the and properties. The following table describes the levels of restriction from most restrictive to least restrictive. - -|Type of restriction|Value of From|Value of To| -|-------------------------|-------------------|-----------------| -|From a specified state to another specified state|The name of a |The name of a | -|From any state to a specified state|Not set|The name of a | -|From a specified state to any state|The name of a |Not set| -|From any state to any other state|Not set|Not set| - - You can have multiple objects in a that refer to the same state, but they will be used in the order that the previous table specifies. - - You can change this behavior by creating a new class that inherits from and overriding the method. - - - -## Examples - The following example creates two objects. When the control transitions from the `Pressed` state to the `MouseOver` state, the that has both and set is used. When the control transitions from a state that is not `Pressed` to the `MouseOver` state, the other state is used. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet7"::: - + property is optional. A can be restricted to apply to only certain states or it can be applied any time the control transitions between states. You restrict when a is applied by setting the and properties. The following table describes the levels of restriction from most restrictive to least restrictive. + +|Type of restriction|Value of From|Value of To| +|-------------------------|-------------------|-----------------| +|From a specified state to another specified state|The name of a |The name of a | +|From any state to a specified state|Not set|The name of a | +|From a specified state to any state|The name of a |Not set| +|From any state to any other state|Not set|Not set| + + You can have multiple objects in a that refer to the same state, but they will be used in the order that the previous table specifies. + + You can change this behavior by creating a new class that inherits from and overriding the method. + + + +## Examples + The following example creates two objects. When the control transitions from the `Pressed` state to the `MouseOver` state, the that has both and set is used. When the control transitions from a state that is not `Pressed` to the `MouseOver` state, the other state is used. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet7"::: + ]]> @@ -174,18 +174,18 @@ Gets or sets the time that it takes to move from one state to another. The time that it takes to move from one state to another. - property. When you set the property, you are specifying the time that it takes for the transition to occur. - - - -## Examples - The following example specifies that the control takes one half second to go into the `MouseOver` state. For the entire example, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippetmouseovertransition"::: - + property. When you set the property, you are specifying the time that it takes for the transition to occur. + + + +## Examples + The following example specifies that the control takes one half second to go into the `MouseOver` state. For the entire example, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippetmouseovertransition"::: + ]]> @@ -225,23 +225,23 @@ Gets or sets a custom mathematical formula that is used to transition between states. A custom mathematical formula that is used to transition between states. - property to specify the way a transition occurs. For example, you can specify an easing function to accelerate or decelerate the transition. For more information, see [Easing Functions](/dotnet/framework/wpf/graphics-multimedia/easing-functions). - - - -## Examples - The following example creates a that causes a to move vertically when the user presses the mouse button over the . The example sets the property to a object to cause the to appear to bounce when it reaches its destination. The that is used when the user releases the button has another object to cause the to bounce before it returns to its original position. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/window1.xaml" id="Snippetvsmeasingfunction"::: - - The following example shows the event handler for the and events. The example calls the method to change the of the canvas. - + property to specify the way a transition occurs. For example, you can specify an easing function to accelerate or decelerate the transition. For more information, see [Easing Functions](/dotnet/framework/wpf/graphics-multimedia/easing-functions). + + + +## Examples + The following example creates a that causes a to move vertically when the user presses the mouse button over the . The example sets the property to a object to cause the to appear to bounce when it reaches its destination. The that is used when the user releases the button has another object to cause the to bounce before it returns to its original position. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/window1.xaml" id="Snippetvsmeasingfunction"::: + + The following example shows the event handler for the and events. The example calls the method to change the of the canvas. + :::code language="csharp" source="~/snippets/csharp/System.Windows/TemplateVisualStateAttribute/Overview/window1.xaml.cs" id="Snippetvsmeasingfunctionlogic"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmcustomcontrol/visualbasic/window1.xaml.vb" id="Snippetvsmeasingfunctionlogic"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/vsmcustomcontrol/visualbasic/window1.xaml.vb" id="Snippetvsmeasingfunctionlogic"::: + ]]> @@ -281,18 +281,18 @@ Gets or sets the that occurs when the transition occurs. The that occurs when the transition occurs. - contains a , the runs any time the is applied. For example, if you want the border of a to change colors when the user moves the mouse away from it, you can create a that has a that changes the button's background. - - - -## Examples - The following example creates a that specifies that when the user moves the mouse away from the control, the control's border changes to blue, then to yellow, and then to black in 1.5 seconds. For the entire example, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet8"::: - + contains a , the runs any time the is applied. For example, if you want the border of a to change colors when the user moves the mouse away from it, you can create a that has a that changes the button's background. + + + +## Examples + The following example creates a that specifies that when the user moves the mouse away from the control, the control's border changes to blue, then to yellow, and then to black in 1.5 seconds. For the entire example, see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet8"::: + ]]> @@ -332,29 +332,29 @@ Gets or sets the name of the to transition to. The name of the to transition to. - property is optional. A can be restricted to apply to only certain states or it can be applied any time the control transitions between states. You restrict when a is applied by setting the and properties. The following table describes the levels of restriction from most restrictive to least restrictive. - -|Type of restriction|Value of From|Value of To| -|-------------------------|-------------------|-----------------| -|From a specified state to another specified state|The name of a |The name of a | -|From any state to a specified state|Not set|The name of a | -|From a specified state to any state|The name of a |Not set| -|From any state to any other state|Not set|Not set| - - You can have multiple objects in a that refer to the same state, but they will be used in the order that the previous table specifies. - - You can change this behavior by creating a new class that inherits from and overriding the method. - - - -## Examples - The following example creates two objects. When the control transitions from the `Pressed` state to the `MouseOver` state, the that has both and set is used. When the control transitions from a state that is not `Pressed` to the `MouseOver` state, the other state is used. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet7"::: - + property is optional. A can be restricted to apply to only certain states or it can be applied any time the control transitions between states. You restrict when a is applied by setting the and properties. The following table describes the levels of restriction from most restrictive to least restrictive. + +|Type of restriction|Value of From|Value of To| +|-------------------------|-------------------|-----------------| +|From a specified state to another specified state|The name of a |The name of a | +|From any state to a specified state|Not set|The name of a | +|From a specified state to any state|The name of a |Not set| +|From any state to any other state|Not set|Not set| + + You can have multiple objects in a that refer to the same state, but they will be used in the order that the previous table specifies. + + You can change this behavior by creating a new class that inherits from and overriding the method. + + + +## Examples + The following example creates two objects. When the control transitions from the `Pressed` state to the `MouseOver` state, the that has both and set is used. When the control transitions from a state that is not `Pressed` to the `MouseOver` state, the other state is used. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/VisualState/Overview/skinnedbutton.xaml" id="Snippet7"::: + ]]> diff --git a/xml/System.Windows/Window.xml b/xml/System.Windows/Window.xml index a5c9c9818bd..a3935bfedf4 100644 --- a/xml/System.Windows/Window.xml +++ b/xml/System.Windows/Window.xml @@ -80,7 +80,7 @@ > The , , , and properties set on a through a style will not be applied at run time. ## Customizing the Window Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the , see [Window Styles and Templates](/dotnet/framework/wpf/controls/window-styles-and-templates). + To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [How to create a template for a control](/dotnet/desktop/wpf/controls/how-to-create-apply-template). To see the parts and states that are specific to the , see [Window Styles and Templates](/dotnet/framework/wpf/controls/window-styles-and-templates). Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running.