Home > General > Same XAML Silverlight and WPF – different result

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>

Categories: General
  1. Mike Greenway
    October 15, 2009 at 2:36 am | #1

    That is diffinetly an unusual feature ;)

  2. October 15, 2009 at 3:33 am | #2

    Lee, I’ll make sure this issue gets filed in the Silverlight bug database. Thanks for the report!

  3. lee
    October 15, 2009 at 2:13 pm | #3

    Thanks

  4. Emiel
    October 22, 2009 at 7:00 am | #4

    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

    • lee
      October 22, 2009 at 9:10 am | #5

      Hi, I think some propertychage notofications are not triggering

  5. Emiel
  6. lee
    October 22, 2009 at 2:45 pm | #7

    Hi,
    Tag is a DependencyProperty, it should not matter where it is in the XAML

  1. October 22, 2009 at 9:55 pm | #1