weizhiyuntest {

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using weizhiyuntest.Resources;
using Microsoft.WindowsAzure.MobileServices;
 
using Newtonsoft.Json;
 
 
namespace weizhiyuntest
{
    public struct xy
    {
        public string x { getset; }
 
        public string y { getset; }
    }
    public partial class MainPage : PhoneApplicationPage
    {
        private IMobileServiceTable<weizhita = App.MobileService.GetTable<weizhi>();
        List<xy> xyo = new List<xy>();
        // 构造函数
        public MainPage()
        {
            InitializeComponent();
 
            // 用于本地化 ApplicationBar 的示例代码
            //BuildLocalizedApplicationBar();
        }
 
        private async void Button_Click(object senderRoutedEventArgs e)
        {
            weizhi w = new weizhi() { lx = "1231"ly = "2424" };
      // await    ta.InsertAsync(w);
 
       //    var biao = await App.MobileService.GetTable<weizhi>().Where(h => h.Id != null).ToCollectionAsync();
            var biao = await App.MobileService.GetTable<weizhi>().ToListAsync();
            foreach (var b in biao.ToList())
            {
                if (!xyo.Contains(new xy{x=b.lx,y=b.ly}))
                {
 
                    xyo.Add(new xy { x = b.lxy = b.ly });
                }
            }
       int a = 0;
 
       lsta.ItemsSource = xyo;
        }
 
        // 用于生成本地化 ApplicationBar 的示例代码
        //private void BuildLocalizedApplicationBar()
        //{
        //    // 将页面的 ApplicationBar 设置为 ApplicationBar 的新实例。
        //    ApplicationBar = new ApplicationBar();
 
        //    // 创建新按钮并将文本值设置为 AppResources 中的本地化字符串。
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);
 
        //    // 使用 AppResources 中的本地化字符串创建新菜单项。
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}
 
       
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using weizhiyuntest.Resources;
using Microsoft.WindowsAzure.MobileServices;
 
using Newtonsoft.Json;
 
namespace weizhiyuntest
{
  public  class weizhi
    {
      public string Id { getset; }
      
      public string lx { getset; }
    
      public string ly { getset; }
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值