Skip to content

Commit 783ec7f

Browse files
committed
Add example of using MultiBinding with Built-in converters
1 parent 1fa01e0 commit 783ec7f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/reference/built-in-data-binding-converters.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,27 @@ This example binding will hide the text block if its bound text is null or empty
5858
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
5959
```
6060

61-
And this example will hide the content control if the bound object is null or empty:
61+
This example will hide the content control if the bound object is null or empty:
6262

6363
```xml
6464
<ContentControl Content="{Binding MyContent}"
6565
IsVisible="{Binding MyContent,
6666
Converter={x:Static ObjectConverters.IsNotNull}}"/>
6767
```
6868

69+
And this example demonstrates binding to multiple bound parameters. It will show the text block if the `MyText` property of the bound object is not null or empty and the `IsMyNotEmptyTextVisible` property is set to `true`:
70+
71+
```xml
72+
<TextBlock Text="{Binding MyText, StringFormat='My text: {0}'}">
73+
<TextBlock.IsVisible>
74+
<MultiBinding Converter="{x:Static BoolConverters.And}">
75+
<Binding Path="MyText" Converter="{x:Static StringConverters.IsNotNullOrEmpty}"/>
76+
<Binding Path="IsMyNotEmptyTextVisible"/>
77+
</MultiBinding>
78+
</TextBlock.IsVisible>
79+
</TextBlock>
80+
```
81+
6982
## More Information
7083

7184

0 commit comments

Comments
 (0)