Same XAML Silverlight and WPF – different result

I did not know the following would produce different results in WPF and Silverlight

<Grid>
        <TextBlock Text=”{Binding RelativeSource={RelativeSource Self}, Path=Tag}” Tag=”hello”/>
    </Grid>

In WPF, you see “Hello”. In silverlight you dont see anything

The following XAML produces same result in WPF and Silverlight

<Grid>
        <TextBlock Tag=”hello” Text=”{Binding RelativeSource={RelativeSource Self}, Path=Tag}” />
    </Grid>

Advertisements

8 thoughts on “Same XAML Silverlight and WPF – different result

  1. Does this hava something to do with the order in which the tags are defined?

    I’ve noticed that in the Silverlight example the Tag-tag is placed before the Text-tag and in the WPF example the other way around

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s