-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLongBindingPath.xaml
33 lines (31 loc) · 1.42 KB
/
LongBindingPath.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- ==================================================
LongBindingPath.xaml (c) 2006 by Charles Petzold
================================================== -->
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
FontSize="12pt"
Name="page">
<StackPanel>
<TextBlock HorizontalAlignment="Center">
First element in StackPanel
</TextBlock>
<ListBox HorizontalAlignment="Center"
Margin="24">
<ListBoxItem>First ListBox Item</ListBoxItem>
<ListBoxItem>Second ListBox Item</ListBoxItem>
<ListBoxItem>Third ListBoxItem</ListBoxItem>
<ListBoxItem>Fourth ListBox Item</ListBoxItem>
<ListBoxItem>Fifth ListBoxItem</ListBoxItem>
</ListBox>
<TextBlock HorizontalAlignment="Center">
<Label Content="Number of characters in third ListBox item = " />
<Label Content="{Binding ElementName=page,
Path=Content.Children[1].Items[2].Content.Length}" />
<LineBreak />
<Label Content="Number of characters in selected item = " />
<Label Content="{Binding ElementName=page,
Path=Content.Children[1].SelectedItem.Content.Length}" />
</TextBlock>
</StackPanel>
</Page>