Ejemplo n.º 1
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="e"></param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            object[] parameters = e.Parameter as object[];
            if (parameters != null && parameters.Length == 1)
            {
                _user = await UserService.GetUserInfo(parameters[0].ToString());
                if (_user != null)
                {
                    PageTitle.Text = _user.Name + " 的信息";
                    BitmapImage bi = new BitmapImage { UriSource = new Uri(_user.Avatar) };
                    UserAvatar.Source = bi;

                    UserName.Text = _user.Name;
                    Age.Text = _user.Age;
                    Followees.Text = _user.Followees;
                    Followers.Text = _user.Followers;
                    BlogHome.Content = _user.BlogHome;
                    Loading.IsActive = false;


                    ListFollowees.ItemsSource = _list_followees = new CNFolloweeList(_user.BlogApp);
                    ListFollowers.ItemsSource = _list_followers = new CNFollowerList(_user.BlogApp);

                    _list_followees.DataLoaded += _list_followees_DataLoaded;
                    _list_followees.DataLoading += _list_followees_DataLoading;

                    _list_followers.DataLoaded += _list_followers_DataLoaded;
                    _list_followers.DataLoading += _list_followers_DataLoading;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="e"></param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            object[] parameters = e.Parameter as object[];
            if (parameters != null && parameters.Length == 1)
            {
                _user = await UserService.GetUserInfo(parameters[0].ToString());

                if (_user != null)
                {
                    PageTitle.Text = _user.Name + " 的信息";
                    BitmapImage bi = new BitmapImage {
                        UriSource = new Uri(_user.Avatar)
                    };
                    UserAvatar.Source = bi;

                    UserName.Text    = _user.Name;
                    Age.Text         = _user.Age;
                    Followees.Text   = _user.Followees;
                    Followers.Text   = _user.Followers;
                    BlogHome.Content = _user.BlogHome;
                    Loading.IsActive = false;


                    ListFollowees.ItemsSource = _list_followees = new CNFolloweeList(_user.BlogApp);
                    ListFollowers.ItemsSource = _list_followers = new CNFollowerList(_user.BlogApp);

                    _list_followees.DataLoaded  += _list_followees_DataLoaded;
                    _list_followees.DataLoading += _list_followees_DataLoading;

                    _list_followers.DataLoaded  += _list_followers_DataLoaded;
                    _list_followers.DataLoading += _list_followers_DataLoading;
                }
            }
        }