Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You need to display the title of the page in a TextBlock control that is placed at the top of a page.
Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You need to display the title of the page in a TextBlock control that is placed at the top of a page.
Which XAML code fragment should you use?

A.
<TextBlock Text="{Binding Path=Title, Source=Page}"/>

B.
<TextBlock Text="{Binding Path=Title, Source={x:Type Page}}"/>

C.
<TextBlock Text="{Binding Path=Title, RelativeSource= {RelativeSource FindAncestor,AncestorType={x:Type Page}}}"/>

D.
<TextBlock Text="{Binding Path=Title, RelativeSource={RelativeSource this}}"/>



Leave a Reply 0

Your email address will not be published. Required fields are marked *