Skip to content

Commit c501311

Browse files
Merge pull request #47322 from v-thpra/azure-triage-fix-321074
Fix for User Feedback 321074: UUF - learn-pr - Use data bindings in XAML - Training | Microsoft Learn
2 parents a3663ff + 5741d85 commit c501311

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

learn-pr/dot-net-maui/separate-ui-and-logic-with-data-binding/includes/3-use-data-bindings-xaml.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Let's look at a simple binding created in XAML by using the `{Binding}` markup e
3030

3131
The binding source is:
3232

33-
- An object instance of the `WeatherService` type. This is referenced through the `{StaticResource ...}` XAML extension, which points to an object in the stack layout's resource dictionary.
33+
- An object instance of the `WeatherService` type. The instance is referenced through the `{StaticResource ...}` XAML extension, which points to an object in the stack layout's resource dictionary.
3434

3535
- The `Path` points to a property named `Humidity` on the `WeatherService` type.
3636

@@ -60,7 +60,7 @@ One useful feature of binding is being able to bind to other controls. The follo
6060
</VerticalStackLayout>
6161
```
6262

63-
The `Slider.Value` property is bound to the `Label.Rotation` property, but in a different way than previously explained. This is using the binding mode `OneWayToSource`, which reverses the typical binding mechanism. Instead of the **Source** updating the **Target**, `OneWayToSource` updates the **Source** when the **Target** changes. In this example when the slider moves, it updates the rotation of the label based on the slider's value, as illustrated in the following animation:
63+
The `Slider.Value` property is bound to the `Label.Rotation` property, but in a different way than previously explained. This property is using the binding mode `OneWayToSource`, which reverses the typical binding mechanism. Instead of the **Source** updating the **Target**, `OneWayToSource` updates the **Source** when the **Target** changes. In this example when the slider moves, it updates the rotation of the label based on the slider's value, as illustrated in the following animation:
6464

6565
:::image type="content" source="../media/3-use-data-bindings-xaml/rotate.gif" alt-text="An animated image of a slider control being dragged with a mouse. As the slider moves, a piece of text rotates to match the position of the slider.":::
6666

@@ -75,7 +75,7 @@ The previous example demonstrated using a static resource as a source for a sing
7575
<VerticalStackLayout.Resources>
7676
<vm:SimpleWeatherServiceObject x:Key="myWeatherService" />
7777
</VerticalStackLayout.Resources>
78-
<Entry Text="{Binding Humidity, Source={StaticResource myWeatherService}}}" />
78+
<Entry Text="{Binding Humidity, Source={StaticResource myWeatherService}}" />
7979
<Label Text="{Binding Path=Humidity, Source={StaticResource myWeatherService}}" />
8080
</VerticalStackLayout>
8181
```
@@ -87,7 +87,7 @@ You don't have to use the same `Path` when using the same `Source`:
8787
<VerticalStackLayout.Resources>
8888
<vm:SimpleWeatherServiceObject x:Key="myWeatherService" />
8989
</VerticalStackLayout.Resources>
90-
<Entry Text="{Binding Temperature, Source={StaticResource myWeatherService}}}" />
90+
<Entry Text="{Binding Temperature, Source={StaticResource myWeatherService}}" />
9191
<Label Text="{Binding Path=Humidity, Source={StaticResource myWeatherService}}" />
9292
</VerticalStackLayout>
9393
```
@@ -96,7 +96,7 @@ Rarely do you present a single piece of data from a source, though it could happ
9696

9797
Setting the `Source` of the binding is optional. A binding that doesn't have `Source` set automatically searches the XAML visual tree for a `BindingContext`, which is set in the XAML or assigned to a parent element by code. Bindings are evaluated following this pattern:
9898

99-
01. If the binding defines a `Source`, that source is used and searching stops. The binding's `Path` is applied to the `Source` to get a value. If `Source` isn't set, the search begins for a binding source.
99+
01. If the binding defines a `Source`, that source is used, and searching stops. The binding's `Path` is applied to the `Source` to get a value. If `Source` isn't set, the search begins for a binding source.
100100

101101
01. The search begins with the target object itself. If the target object's `BindingContext` isn't null, the search stops and the binding's `Path` is applied to the `BindingContext` to get a value. If the `BindingContext` is null, then the search continues.
102102

0 commit comments

Comments
 (0)