尝试定义对象的集合时,项目不再构建,并引发以下错误:
- 属性“dboForeignReleaseIds”只能设置一次。
- 无法分配指定的值。预期以下类型:“IList`1”。
如何在 XAML 中初始化对象的集合?
在从类创建示例数据时,我遵循了与 Blend 相同的模式,您可能会问我为什么不使用它呢?因为它仅在设计时可用,而不是在运行时可用。
<echoNestModel:dboTrackProfile x:Key="dboTrackProfile"
Title="El Amor"
AnalyzerVersion="3.13"
Artist="Joeski"
ArtistId="4564123113"
AudioMd5="HJK34YKUGH34J3"
Bitrate="320"
PreviewUrl="http:\\www.echonest.com"
Release="El Amor Remixes"
ReleaseImage="image"
Samplerate="44100"
SongId="4U623784Y2HJ"
Status="OK"
dboId="19">
<!-- errors from here -->
<echoNestModel:dboTrackProfile.dboForeignReleaseIds>
<echoNestModel:dboForeignReleaseId dboId="54" Value="Rutrum vivamus sapien tristique" />
<echoNestModel:dboForeignReleaseId dboId="70" Value="Parturient vestibulum" />
<echoNestModel:dboForeignReleaseId dboId="71" Value="Sed aliquam ultricies morbi vestibulum" />
<echoNestModel:dboForeignReleaseId dboId="69" Value="Adipiscing senectus sociosqu aliquet parturient" />
<echoNestModel:dboForeignReleaseId dboId="43" Value="Suscipit sem" />
<echoNestModel:dboForeignReleaseId dboId="25" Value="Torquent sit" />
<echoNestModel:dboForeignReleaseId dboId="23" Value="Semper venenatis" />
<echoNestModel:dboForeignReleaseId dboId="16" Value="Blandit vulputate vel vestibulum ultrices" />
<echoNestModel:dboForeignReleaseId dboId="29" Value="Vehicula erat volutpat nulla" />
<echoNestModel:dboForeignReleaseId dboId="30" Value="Eros maecenas nibh curabitur proin" />
</echoNestModel:dboTrackProfile.dboForeignReleaseIds>
<!-- to here -->
</echoNestModel:dboTrackProfile>