Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
464 views
in Technique[技术] by (71.8m points)

windows phone 8 - Binding Sampledata WindowsPhone

I have a simple class with a property List Photos. You know by default in many sample of code you find a sampledata. Each time, it presents a simple property as a string. This sampledata is used to populate the designer and you can see the render without to compile. So I try to find a way to have a sampledata with a List filled. I try to use the functionnality from Blend permitting to generate data but it doesn't work with List.

You can see below the code generate. It miss the property List. And I don't find any documentation explaning clearly the binding in details.

<ViewModels:ItemViewModel xmlns:ViewModels="clr-namespace:RssReader.ViewModels" 
                      Description="Aliquam aenean integer quisque mauris" 
                      Link="Maecenas vivamus" 
                      Title="Praesent curabitur aliquam nullam phasellus"/>

My assumption is I need to add something as

<ViewModels:ItemViewModel xmlns:ViewModels="clr-namespace:RssReader.ViewModels" 
                      Description="Aliquam aenean integer quisque mauris" 
                      Link="Maecenas vivamus" 
                      Title="Praesent curabitur aliquam nullam phasellus"                           
                      <Photos x:Key="strings" Type="sys:List" 
                                xmlns:sys="clr-namespace:System;assembly=mscorlib">
                                <sys:String>Photos1</sys:String>
                                <sys:String>Photos2</sys:String> >
                    </Photos>

But it's not the correct syntax. Can you provide an help to solve it. This topic is link to the subject Databinding List<Object> WindowsPhone

Best regards, Alexandre

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...