首页 新闻 搜索 专区 学院

windows phone 8 longlistselector 绑定后不显示(已赋代码,求指教)

0
悬赏园豆:40 [已关闭问题] 关闭于 2013-03-26 10:48
<phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="llsItem" >
            <StackPanel x:Name="spItem" HorizontalAlignment="Left" Orientation="Horizontal"   >
                <TextBlock x:Name="tbName" Width="40" Height="40" Text="{Binding User_ContactID}" FontSize="15" Foreground="BlueViolet" ></TextBlock>
                <TextBlock x:Name="tbId" Width="30" Height="40" Text="{Binding Login_ID}"  Foreground="White"></TextBlock>
            </StackPanel>
        </DataTemplate>
<phone:PhoneApplicationPage.Resources>
<phone:Pivot HorizontalAlignment="Left" Height="690"  Title="Video Conference" VerticalAlignment="Top" Width="480" >

            <phone:PivotItem CacheMode="{x:Null}" Header="常用会议"  >
                <Button Content="Button" HorizontalAlignment="Left" Height="510" VerticalAlignment="Top" Width="183" Click="Button_Click_1"/>                
            </phone:PivotItem>

            <phone:PivotItem Height="510" CacheMode="{x:Null}" Header="联系人" Margin="12,28,-263,0">
                <phone:LongListSelector  Height="500" x:Name="llsContact" IsGroupingEnabled="True" ItemsSource="{Binding}" ItemTemplate="{StaticResource llsItem}" Margin="0,0,0,0">
                    
                </phone:LongListSelector>
            </phone:PivotItem>
        </phone:Pivot>
public MainPage()
        {
            InitializeComponent();

            ServiceReference1.WebServiceSoapClient ws = new ServiceReference1.WebServiceSoapClient();
            ws.FriendCompleted += ws_FriendCompleted;
            ws.FriendAsync(IsolatedStorageSettings.ApplicationSettings["uid"].ToString());

         }

        void ws_FriendCompleted(object sender, ServiceReference1.FriendCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                IEnumerable<XElement> lx = e.Result.Nodes[1].Descendants("Table1");
                List<Model.User> lu = new List<Model.User>();
                foreach (var item in lx)
                {
                    lu.Add(new Model.User()
                    {
                        Login_ID = item.Element("Login_ID").Value,
                        UserName = item.Element("UserName").Value,
                                                
                    }
                    );

                }
                llsContact.ItemsSource = lu;
                
            }
            else MessageBox.Show("联系人列表载入失败" + e.Error.Message);
        }

运行后,看不到绑定的数据,求帮助???!!!!

关健的主页 关健 | 菜鸟二级 | 园豆:202
提问于:2013-03-26 00:00
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册