Skip to content

Commit 9c1166c

Browse files
WinUI x:Bind function binding - add tip for TargetNullValue (#5649)
* Add TargetNullValue tip to function binding topic * Remove formatting that doesn't render anyway. * Update topic to call them winui apps
1 parent 7cf7104 commit 9c1166c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

hub/apps/develop/data-binding/function-bindings.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
2-
description: Learn about using functions as the leaf step of the data binding path in the xBind markup extension.
3-
title: Functions in x:Bind with Windows App SDK
4-
ms.date: 12/13/2022
5-
ms.topic: article
6-
keywords: windows 10, windows 11, windows app sdk, xaml, winui, windows ui, xBind
2+
description: Learn about using functions as the leaf step of the data binding path in the xBind markup extension in WinUI apps with the Windows App SDK.
3+
title: Functions in x:Bind with WinUI
4+
ms.date: 07/30/2025
5+
ms.topic: concept-article
6+
keywords: windows 10, windows 11, windows app sdk, xaml, winui, windows ui, xBind, winui 3
77
ms.localizationpriority: medium
8+
# Customer intent: As a Windows developer, I want to learn how to use functions in x:Bind so that I can simplify value conversion and create more complex bindings in my WinUI apps.
89
---
910

10-
# Functions in x:Bind with Windows App SDK
11+
# Functions in x:Bind with WinUI
1112

1213
> [!NOTE]
1314
> For general info about using data binding in your app with `{x:Bind}` (and for an all-up comparison between `{x:Bind}` and `{Binding}`), see [Data binding in depth](data-binding-in-depth.md) and [{x:Bind} Markup Extension](/windows/uwp/xaml-platform/x-bind-markup-extension).
1415
15-
In Windows App SDK apps, **{x:Bind}** supports using a function as the leaf step of the binding path. This enables:
16+
In WinUI apps, **{x:Bind}** supports using a function as the leaf step of the binding path. This enables:
1617

1718
- A simpler way to achieve value conversion
1819
- A way for bindings to depend on more than one parameter
@@ -168,6 +169,9 @@ Multiple function arguments can be specified, separated by comma's (,)
168169
- Constant Number - for example -123.456
169170
- Boolean – specified as "x:True" or "x:False"
170171

172+
> [!TIP]
173+
> [TargetNullValue](/windows/uwp/xaml-platform/x-bind-markup-extension#properties-that-you-can-set-with-xbind) will apply to the result of the function call, not to any bound arguments.
174+
171175
### Two way function bindings
172176

173177
In a two-way binding scenario, a second function must be specified for the reverse direction of the binding. This is done using the `BindBack` binding property. In the below example, the function should take one argument which is the value that needs to be pushed back to the model.

0 commit comments

Comments
 (0)