|
<Window x:Class="WPFSampleApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="300" Width="300">
<Grid Tag="Sample text">
<!--This is an example of good binding-->
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid}}, Path=Tag}"/>
<!--This is an example of BAD binding. TagX is not a property of the Grid this will make the unit tests fail-->
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid}}, Path=TagX}"/>
</Grid>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.