2
當試圖定義一個對象的集合,項目並沒有編譯和下面的錯誤提出:初始化XAML對象的集合
- 屬性「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>