Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ You can apply different styling to a WPF control to change its appearance and be
- [Migration and Interoperability](../../wpf/advanced/migration-and-interoperability.md)
- [Using WPF Controls](using-wpf-controls.md)
- [Design XAML in Visual Studio](/visualstudio/xaml-tools/designing-xaml-in-visual-studio)
- [XAML Overview (WPF)](../../wpf/advanced/xaml-overview-wpf.md)
- [XAML Overview (WPF)](../../../desktop-wpf/fundamentals/xaml.md)
- [Styling and Templating](../../../desktop-wpf/fundamentals/styles-templates-overview.md)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ When users enter data into your application, you may want to verify that the dat

- If the postal code must belong to a specific group of zip codes, you can perform a string comparison on the input to validate the data entered by the user. For example, if the postal code must be in the set {10001, 10002, 10003}, then you can use a string comparison to validate the data.

- If the postal code must be in a specific form you can use regular expressions to validate the data entered by the user. For example, to validate the form `#####` or `#####-####`, you can use the regular expression `^(\d{5})(-\d{4})?$`. To validate the form `A#A #A#`, you can use the regular expression `[A-Z]\d[A-Z] \d[A-Z]\d`. For more information about regular expressions, see [.NET Framework Regular Expressions](../../standard/base-types/regular-expressions.md) and [Regular Expression Examples](../../standard/base-types/regular-expression-examples.md).
- If the postal code must be in a specific form you can use regular expressions to validate the data entered by the user. For example, to validate the form `#####` or `#####-####`, you can use the regular expression `^(\d{5})(-\d{4})?$`. To validate the form `A#A #A#`, you can use the regular expression `[A-Z]\d[A-Z] \d[A-Z]\d`. For more information about regular expressions, see [.NET Framework Regular Expressions](../../standard/base-types/regular-expressions.md) and [Regular Expression Examples](../../standard/base-types/regular-expression-example-scanning-for-hrefs.md).

- If the postal code must be a valid United States Zip code, you could call a Zip code Web service to validate the data entered by the user.

Expand Down Expand Up @@ -90,4 +90,4 @@ When users enter data into your application, you may want to verify that the dat
- <xref:System.Windows.Forms.Form.FormClosing?displayProperty=nameWithType>
- <xref:System.Windows.Forms.FormClosingEventArgs?displayProperty=nameWithType>
- [MaskedTextBox Control](./controls/maskedtextbox-control-windows-forms.md)
- [Regular Expression Examples](../../standard/base-types/regular-expression-examples.md)
- [Regular Expression Examples](../../standard/base-types/regular-expression-example-scanning-for-hrefs.md)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The following is an example of how you can set <xref:System.Windows.Controls.Doc

Note that the usage is somewhat similar to a static property; you always reference the type <xref:System.Windows.Controls.DockPanel> that owns and registers the attached property, rather than referring to any instance specified by name.

Also, because an attached property in XAML is an attribute that you set in markup, only the set operation has any relevance. You cannot directly get a property in XAML, although there are some indirect mechanisms for comparing values, such as triggers in styles (for details, see [Styling and Templating](../controls/styling-and-templating.md)).
Also, because an attached property in XAML is an attribute that you set in markup, only the set operation has any relevance. You cannot directly get a property in XAML, although there are some indirect mechanisms for comparing values, such as triggers in styles (for details, see [Styling and Templating](../../../desktop-wpf/fundamentals/styles-templates-overview.md)).

### Attached Property Implementation in WPF

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/wpf/advanced/base-elements-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A high percentage of classes in [!INCLUDE[TLA#tla_winclient](../../../../include

- Support for styling and storyboards. For more information, see <xref:System.Windows.Style> and [Storyboards Overview](../graphics-multimedia/storyboards-overview.md).

- Support for data binding. For more information, see [Data Binding Overview](../data/data-binding-overview.md).
- Support for data binding. For more information, see [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md).

- Support for dynamic resource references. For more information, see [XAML Resources](../../../desktop-wpf/fundamentals/xaml-resources-define.md).

Expand All @@ -61,7 +61,7 @@ A high percentage of classes in [!INCLUDE[TLA#tla_winclient](../../../../include

- Support for styling and storyboards. For more information, see <xref:System.Windows.Style> and [Animation Overview](../graphics-multimedia/animation-overview.md).

- Support for data binding. For more information, see [Data Binding Overview](../data/data-binding-overview.md).
- Support for data binding. For more information, see [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md).

- Support for dynamic resource references. For more information, see [XAML Resources](../../../desktop-wpf/fundamentals/xaml-resources-define.md).

Expand Down
12 changes: 6 additions & 6 deletions docs/framework/wpf/advanced/binding-markup-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Defers a property value to be a data-bound value, creating an intermediate expre
|`path`|The path string that sets the implicit <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> property. See also [PropertyPath XAML Syntax](propertypath-xaml-syntax.md).|

## Unqualified {Binding}
The `{Binding}` usage shown in "Binding Expression Usage" creates a <xref:System.Windows.Data.Binding> object with default values, which includes an initial <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> of `null`. This is still useful in many scenarios, because the created <xref:System.Windows.Data.Binding> might be relying on key data binding properties such as <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> and <xref:System.Windows.Data.Binding.Source%2A?displayProperty=nameWithType> being set in the run-time data context. For more information on the concept of data context, see [Data Binding](../data/data-binding-wpf.md).
The `{Binding}` usage shown in "Binding Expression Usage" creates a <xref:System.Windows.Data.Binding> object with default values, which includes an initial <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> of `null`. This is still useful in many scenarios, because the created <xref:System.Windows.Data.Binding> might be relying on key data binding properties such as <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> and <xref:System.Windows.Data.Binding.Source%2A?displayProperty=nameWithType> being set in the run-time data context. For more information on the concept of data context, see [Data Binding](../../../desktop-wpf/data/data-binding-overview.md).

## Implicit Path
The `Binding` markup extension uses <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> as a conceptual "default property", where `Path=` does not need to appear in the expression. If you specify a `Binding` expression with an implicit path, the implicit path must appear first in the expression, prior to any other `bindProp`=`value` pairs where the <xref:System.Windows.Data.Binding> property is specified by name. For example: `{Binding PathString}`, where `PathString` is a string that is evaluated to be the value of <xref:System.Windows.Data.Binding.Path%2A?displayProperty=nameWithType> in the <xref:System.Windows.Data.Binding> created by the markup extension usage. You can append an implicit path with other named properties after the comma separator, for example, `{Binding LastName, Mode=TwoWay}`.
Expand All @@ -58,7 +58,7 @@ Defers a property value to be a data-bound value, creating an intermediate expre

- <xref:System.Windows.Data.Binding.ConverterParameter%2A>: can be set as a `bindProp`=`value` string in the expression, but this is dependent on the type of the parameter being passed. If passing a reference type for the value, this usage requires an object reference such as a nested [StaticResource Markup Extension](staticresource-markup-extension.md).

- <xref:System.Windows.Data.Binding.ElementName%2A>: mutually exclusive versus <xref:System.Windows.Data.Binding.RelativeSource%2A> and <xref:System.Windows.Data.Binding.Source%2A>; each of these binding properties represents a particular binding methodology. See [Data Binding Overview](../data/data-binding-overview.md).
- <xref:System.Windows.Data.Binding.ElementName%2A>: mutually exclusive versus <xref:System.Windows.Data.Binding.RelativeSource%2A> and <xref:System.Windows.Data.Binding.Source%2A>; each of these binding properties represents a particular binding methodology. See [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md).

- <xref:System.Windows.Data.BindingBase.FallbackValue%2A>: can be set as a `bindProp`=`value` string in the expression, but this is dependent on the type of the value being passed. If passing a reference type, requires an object reference such as a nested [StaticResource Markup Extension](staticresource-markup-extension.md).

Expand All @@ -74,9 +74,9 @@ Defers a property value to be a data-bound value, creating an intermediate expre

- <xref:System.Windows.Data.Binding.Path%2A>: a string that describes a path into a data object or a general object model. The format provides several different conventions for traversing an object model that cannot be adequately described in this topic. See [PropertyPath XAML Syntax](propertypath-xaml-syntax.md).

- <xref:System.Windows.Data.Binding.RelativeSource%2A>: mutually exclusive versus with <xref:System.Windows.Data.Binding.ElementName%2A> and <xref:System.Windows.Data.Binding.Source%2A>; each of these binding properties represents a particular binding methodology. See [Data Binding Overview](../data/data-binding-overview.md). Requires a nested [RelativeSource MarkupExtension](relativesource-markupextension.md) usage to specify the value.
- <xref:System.Windows.Data.Binding.RelativeSource%2A>: mutually exclusive versus with <xref:System.Windows.Data.Binding.ElementName%2A> and <xref:System.Windows.Data.Binding.Source%2A>; each of these binding properties represents a particular binding methodology. See [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md). Requires a nested [RelativeSource MarkupExtension](relativesource-markupextension.md) usage to specify the value.

- <xref:System.Windows.Data.Binding.Source%2A>: mutually exclusive versus <xref:System.Windows.Data.Binding.RelativeSource%2A> and <xref:System.Windows.Data.Binding.ElementName%2A>; each of these binding properties represents a particular binding methodology. See [Data Binding Overview](../data/data-binding-overview.md). Requires a nested extension usage, typically a [StaticResource Markup Extension](staticresource-markup-extension.md) that refers to an object data source from a keyed resource dictionary.
- <xref:System.Windows.Data.Binding.Source%2A>: mutually exclusive versus <xref:System.Windows.Data.Binding.RelativeSource%2A> and <xref:System.Windows.Data.Binding.ElementName%2A>; each of these binding properties represents a particular binding methodology. See [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md). Requires a nested extension usage, typically a [StaticResource Markup Extension](staticresource-markup-extension.md) that refers to an object data source from a keyed resource dictionary.

- <xref:System.Windows.Data.BindingBase.StringFormat%2A>: a string that describes a string format convention for the bound data. This is a relatively advanced binding concept; see reference page for <xref:System.Windows.Data.BindingBase.StringFormat%2A>.

Expand All @@ -103,7 +103,7 @@ Defers a property value to be a data-bound value, creating an intermediate expre
> [!IMPORTANT]
> In terms of dependency property precedence, a `Binding` expression is equivalent to a locally set value. If you set a local value for a property that previously had a `Binding` expression, the `Binding` is completely removed. For details, see [Dependency Property Value Precedence](dependency-property-value-precedence.md).

Describing data binding at a basic level is not covered in this topic. See [Data Binding Overview](../data/data-binding-overview.md).
Describing data binding at a basic level is not covered in this topic. See [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md).

> [!NOTE]
> <xref:System.Windows.Data.MultiBinding> and <xref:System.Windows.Data.PriorityBinding> do not support a [!INCLUDE[TLA2#tla_xaml](../../../../includes/tla2sharptla-xaml-md.md)] extension syntax. You would instead use property elements. See reference topics for <xref:System.Windows.Data.MultiBinding> and <xref:System.Windows.Data.PriorityBinding>.
Expand All @@ -119,6 +119,6 @@ Defers a property value to be a data-bound value, creating an intermediate expre
## See also

- <xref:System.Windows.Data.Binding>
- [Data Binding Overview](../data/data-binding-overview.md)
- [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md)
- [XAML Overview (WPF)](../../../desktop-wpf/fundamentals/xaml.md)
- [Markup Extensions and WPF XAML](markup-extensions-and-wpf-xaml.md)
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ As mentioned in the [Dependency Properties Overview](dependency-properties-overv

When you implement a property on a class, so long as your class derives from <xref:System.Windows.DependencyObject>, you have the option to back your property with a <xref:System.Windows.DependencyProperty> identifier and thus to make it a dependency property. Having your property be a dependency property is not always necessary or appropriate, and will depend on your scenario needs. Sometimes, the typical technique of backing your property with a private field is adequate. However, you should implement your property as a dependency property whenever you want your property to support one or more of the following [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] capabilities:

- You want your property to be settable in a style. For more information, see [Styling and Templating](../controls/styling-and-templating.md).
- You want your property to be settable in a style. For more information, see [Styling and Templating](../../../desktop-wpf/fundamentals/styles-templates-overview.md).

- You want your property to support data binding. For more information about data binding dependency properties, see [Bind the Properties of Two Controls](../data/how-to-bind-the-properties-of-two-controls.md).

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/wpf/advanced/dependency-properties-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The following example sets the <xref:System.Windows.Controls.ContentControl.Cont
> [!NOTE]
> Bindings are treated as a local value, which means that if you set another local value, you will eliminate the binding. For details, see [Dependency Property Value Precedence](dependency-property-value-precedence.md).

Dependency properties, or the <xref:System.Windows.DependencyObject> class, do not natively support <xref:System.ComponentModel.INotifyPropertyChanged> for purposes of producing notifications of changes in <xref:System.Windows.DependencyObject> source property value for data binding operations. For more information on how to create properties for use in data binding that can report changes to a data binding target, see [Data Binding Overview](../data/data-binding-overview.md).
Dependency properties, or the <xref:System.Windows.DependencyObject> class, do not natively support <xref:System.ComponentModel.INotifyPropertyChanged> for purposes of producing notifications of changes in <xref:System.Windows.DependencyObject> source property value for data binding operations. For more information on how to create properties for use in data binding that can report changes to a data binding target, see [Data Binding Overview](../../../desktop-wpf/data/data-binding-overview.md).

### Styles
Styles and templates are two of the chief motivating scenarios for using dependency properties. Styles are particularly useful for setting properties that define application [!INCLUDE[TLA#tla_ui](../../../../includes/tlasharptla-ui-md.md)]. Styles are typically defined as resources in XAML. Styles interact with the property system because they typically contain "setters" for particular properties, as well as "triggers" that change a property value based on the real-time value for another property.
Expand All @@ -128,7 +128,7 @@ The following example creates a simple style (which would be defined inside a <x

[!code-xaml[PropertiesOvwSupport#SimpleStyle](~/samples/snippets/csharp/VS_Snippets_Wpf/PropertiesOvwSupport/CSharp/page3.xaml#simplestyle)]

For more information, see [Styling and Templating](../controls/styling-and-templating.md).
For more information, see [Styling and Templating](../../../desktop-wpf/fundamentals/styles-templates-overview.md).

### Animations
Dependency properties can be animated. When an animation is applied and is running, the animated value operates at a higher precedence than any value (such as a local value) that the property otherwise has.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Provides a value for any [!INCLUDE[TLA2#tla_xaml](../../../../includes/tla2sharp
> [!IMPORTANT]
> In terms of dependency property precedence, a `DynamicResource` expression is equivalent to the position where the dynamic resource reference is applied. If you set a local value for a property that previously had a `DynamicResource` expression as the local value, the `DynamicResource` is completely removed. For details, see [Dependency Property Value Precedence](dependency-property-value-precedence.md).

Certain resource access scenarios are particularly appropriate for `DynamicResource` as opposed to a [StaticResource Markup Extension](staticresource-markup-extension.md). See [XAML Resources](xaml-resources.md) for a discussion about the relative merits and performance implications of `DynamicResource` and `StaticResource`.
Certain resource access scenarios are particularly appropriate for `DynamicResource` as opposed to a [StaticResource Markup Extension](staticresource-markup-extension.md). See [XAML Resources](../../../desktop-wpf/fundamentals/xaml-resources-define.md) for a discussion about the relative merits and performance implications of `DynamicResource` and `StaticResource`.

The specified <xref:System.Windows.DynamicResourceExtension.ResourceKey%2A> should correspond to an existing resource determined by [x:Key Directive](../../../desktop-wpf/xaml-services/xkey-directive.md) at some level in your page, application, the available control themes and external resources, or system resources, and the resource lookup will happen in that order. For more information about resource lookup for static and dynamic resources, see [XAML Resources](xaml-resources.md).
The specified <xref:System.Windows.DynamicResourceExtension.ResourceKey%2A> should correspond to an existing resource determined by [x:Key Directive](../../../desktop-wpf/xaml-services/xkey-directive.md) at some level in your page, application, the available control themes and external resources, or system resources, and the resource lookup will happen in that order. For more information about resource lookup for static and dynamic resources, see [XAML Resources](../../../desktop-wpf/fundamentals/xaml-resources-define.md).

A resource key may be any string defined in the [XamlName Grammar](../../../desktop-wpf/xaml-services/xamlname-grammar.md). A resource key may also be other object types, such as a <xref:System.Type>. A <xref:System.Type> key is fundamental to how controls can be styled by themes. For more information, see [Control Authoring Overview](../controls/control-authoring-overview.md).

Expand All @@ -68,7 +68,7 @@ Provides a value for any [!INCLUDE[TLA2#tla_xaml](../../../../includes/tla2sharp

## See also

- [XAML Resources](xaml-resources.md)
- [XAML Resources](../../../desktop-wpf/fundamentals/xaml-resources-define.md)
- [Resources and Code](resources-and-code.md)
- [x:Key Directive](../../../desktop-wpf/xaml-services/xkey-directive.md)
- [XAML Overview (WPF)](../../../desktop-wpf/fundamentals/xaml.md)
Expand Down
Loading