Пример #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            string parameter;

            if (NavigationContext.QueryString.TryGetValue("user", out parameter))
            {
                if (parameter == WeBallAPI.currentUser._id)
                {
                    FirstNamePrompt.Text     = WeBallAPI.currentUser.fullName;
                    profileStack.DataContext = WeBallAPI.currentUser;
                }
                else
                {
                    await WeBallAPI.getUser(parameter);

                    addFriend.Opacity   = 100;
                    addFriend.IsEnabled = true;
                    if (WeBallAPI.Success == false)
                    {
                        return;
                    }

/*                    if (WeBallAPI.profileUser.relationStatus.isRelation == 0)
 *                  {
 *                      addFriend.Opacity = 100;
 *                      GridAdd.Background = new SolidColorBrush(Colors.Orange);
 *                  }
 *                  else if (WeBallAPI.profileUser.relationStatus.isRelation == 2)
 *                  {
 *                      addFriend.Opacity = 100;
 *                      GridAdd.Background = new SolidColorBrush(Colors.Green);
 *                  }
 *                  else
 *                  {
 *                      addFriend.Opacity = 100;
 *                      addFriend.IsEnabled = true;
 *                  }*/
                    FirstNamePrompt.Text     = WeBallAPI.profileUser.fullName;
                    profileStack.DataContext = WeBallAPI.profileUser;
                }
            }
            else
            {
                await WeBallAPI.me();

                if (WeBallAPI.Success == false)
                {
                    return;
                }
                FirstNamePrompt.Text     = WeBallAPI.currentUser.fullName;
                profileStack.DataContext = WeBallAPI.currentUser;
            }
        }