• 启动器和选择器学习(7)选择器之联系人信息保存


    namespace Microsoft.Phone.Tasks
    {
        public sealed class SaveContactTask : ChooserBase<savecontactresult>
        {
            public string FirstName { get; set; }
            public string LastName { get; set; }
            public string MiddleName { get; set; }
            public string Nickname { get; set; }
            public string Suffix { get; set; }
            public string Company { get; set; }
            public string Title { get; set; }
            public string MobilePhone { get; set; }
            public string HomePhone { get; set; }
            public string WorkPhone { get; set; }
            public string PersonalEmail { get; set; }
            public string WorkEmail { get; set; }
            public string OtherEmail { get; set; }
            public string HomeAddressStreet { get; set; }
            public string HomeAddressCity { get; set; }
            public string HomeAddressState { get; set; }
            public string HomeAddressZipCode { get; set; }
            public string HomeAddressCountry { get; set; }
            public string WorkAddressStreet { get; set; }
            public string WorkAddressCity { get; set; }
            public string WorkAddressState { get; set; }
            public string WorkAddressZipCode { get; set; }
            public string WorkAddressCountry { get; set; }
            public string Website { get; set; }
            public string Notes { get; set; }
            public string JobTitle { get; set; }
    
            public override void Show();
        }
    }

    1.创建选择器并添加选择器操作完成事件(Completed)

    SaveContactTask _SaveContact = new SaveContactTask();
    _SaveContact.Completed += new EventHandler<SaveContactResult>(SaveContactCompleted);

    2.为选择器赋值(联系人信息)并调用选择器

    _SaveContact.FirstName = "张三";
    _SaveContact.MobilePhone = "15812345678";
    _SaveContact.WorkEmail = "huqg@founder.com";
    _SaveContact.Show();

    3.选择器操作完成事件

    void SaveContactCompleted(object sender, SaveContactResult e)
    {
        string nNotifyMessage = string.Empty;
        switch (e.TaskResult)
        {
            case TaskResult.OK:
                nNotifyMessage = "保存联系人成功!";
                break;
            case TaskResult.Cancel:
                nNotifyMessage = "用户取消了操作!";
                break;
            case TaskResult.None:
                nNotifyMessage = "联系人未被保存!";
                break;
        }
        if (_PageModel != null)
            _PageModel.SystemTrayNotify(nNotifyMessage);
        else
            MessageBox.Show(nNotifyMessage);
    }
  • 相关阅读:
    Postfix常用命令和邮件队列管理(queue)
    window7下面rabbitMQ安装配置过程详解
    RabbitMQ系列之消息确认机制
    全文检索:sphinx elasticsearch xunsearch 比较
    用SQL命令查看Mysql数据库大小
    部署Percona监控和管理--- PMM Server
    什么是MTU?为什么MTU值普遍都是1500?
    Mysql删除数据后,磁盘空间未释放的解决办法
    数据库索引
    visual studio 容器工具首次加载太慢 vsdbgvs2017u5 exists, deleting 的解决方案
  • 原文地址:https://www.cnblogs.com/qq278360339/p/2670430.html
Copyright © 2020-2023  润新知