Exemple #1
0
        private async void participateBtn_Click(object sender, RoutedEventArgs e)
        {
            String token = Global.Store.getInstance().token;
            bool   flag  = false;

            switch (participateBtn.Content)
            {
            case "参加":
                flag = await EventServices.participateEvent(token, id);

                break;

            case "退出":
                flag = await EventServices.exitEvent(token, id);

                break;

            case "删除":
                flag = await EventServices.deleteEvent(token, id);

                break;
            }
            if (flag)
            {
                await new MessageDialog(participateBtn.Content + "事件成功!").ShowAsync();
                if ((String)participateBtn.Content == "删除")
                {
                    ControlBar.Current.NavigateToPage("Index");
                    return;
                }
            }
            while (participatorList.Count > 0)
            {
                participatorList.RemoveAt(0);
            }
            getDetailEvent(id);
            TileService.UpdateTiles();
        }