the property 'Content' is set more than once

前端 未结 2 1799
闹比i
闹比i 2021-01-17 18:16

I am having the following XAML code, which throws error following error pointing to line# 16.

the property \'Content\' is set more than once

相关标签:
2条回答
  • 2021-01-17 18:54

    The Content property is normally mapped to whatever is between the <X> and </X> tags, e.g.

    <Control>
        This stuff is set to the Content property
    </Control>
    

    But it can also be set like a normal property, e.g.

    <Control Content="This stuff is set to the Content property" />
    

    In your example you are doing both by setting the Content property on line 15 like a normal property and again on line 16 between the tags. I'm guessing you will want to get rid of the Content="Viewer" on line 15 to get the output you are looking for.

    0 讨论(0)
  • 2021-01-17 18:55

    In line 15 you set the Content in the Attribute and in line 16 you have the Image as 2. content.

    0 讨论(0)
提交回复
热议问题