Beispiel #1
0
        private async void InitializeUser()
        {
            usernameText.Text = username;
            Dictionary <string, string> info = await NetworkControl.QueryUserInfo(username);

            string imageUrl = info.GetValueOrDefault <string, string>("imageUrl");
            var    newSrc   = new BitmapImage(new Uri(NetworkControl.GetFullPathUrl(imageUrl), UriKind.Absolute));

            newSrc.CreateOptions     = BitmapCreateOptions.IgnoreImageCache;
            personPic.ProfilePicture = newSrc;
        }
Beispiel #2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            string[] temp = e.Parameter as string[];
            username = temp[0];
            password = temp[1];
            Dictionary <string, string> info = await NetworkControl.QueryUserInfo(username);

            string imageUrl = info.GetValueOrDefault <string, string>("imageUrl");
            string phone    = info.GetValueOrDefault <string, string>("phone");
            string email    = info.GetValueOrDefault <string, string>("email");
            var    newSrc   = new BitmapImage(new Uri(NetworkControl.GetFullPathUrl(imageUrl), UriKind.Absolute));

            newSrc.CreateOptions     = BitmapCreateOptions.IgnoreImageCache;
            personPic.ProfilePicture = newSrc;
            usernameBlock.Text       = username;
            phoneBlock.Text          = phone;
            emailBlock.Text          = email;
            oldPhone = phone;
            oldEmail = email;
        }
Beispiel #3
0
        private async void UserNameBox_LostFocus(object sender, RoutedEventArgs e)
        {
            if (UserNameBox.Text.Length != 0)
            {
                string name = UserNameBox.Text;
                var    res  = await NetworkControl.QueryUserInfo(name);

                UserNameMsg.Text = "";
                if (res["code"] == "0")
                {
                    UserNameMsg.Text = res["errMessage"];
                }
                else if (res["code"] == "1")
                {
                    string imgUrl = res["imageUrl"];
                    var    newSrc = new BitmapImage(new Uri(NetworkControl.GetFullPathUrl(imgUrl), UriKind.Absolute));
                    newSrc.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
                    Logo.Source          = newSrc;
                }
            }
        }