Пример #1
0
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListView      imageList = (ListView)sender;
            DreamingModel dreaming  = (imageList.DataContext) as DreamingModel;

            Frame.Navigate(typeof(ImageView), dreaming);
        }
Пример #2
0
        //评论
        private void comment_Click(object sender, RoutedEventArgs e)
        {
            Button        btn      = (Button)sender;
            DreamingModel dreaming = (btn.DataContext) as DreamingModel;

            Frame.Navigate(typeof(DreamingComment), dreaming);
        }
Пример #3
0
        //点赞
        private void praise_Click(object sender, RoutedEventArgs e)
        {
            Button        btn      = (Button)sender;
            DreamingModel dreaming = (btn.DataContext) as DreamingModel;

            HtppPostPraise.HttpPost(dreaming._id, dreaming.user_phone, Config.UserPhone, Config.UserImage, Config.UserName);
            btn.Content   = ((int)btn.Content + 1).ToString();
            btn.IsEnabled = false;
        }
Пример #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                dreaming = (DreamingModel)e.Parameter;

                this.flipview.ItemsSource = dreaming.image;
            }
        }
Пример #5
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter != null && e.Parameter is DreamingModel)
     {
         dreaming             = (DreamingModel)e.Parameter;
         postGrid.DataContext = dreaming;
         LoadComment(dreaming._id);
     }
     else if (e.Parameter != null && e.Parameter is UserModel)
     {
         UserModel user = e.Parameter as UserModel;
         LoadPost(user.day);
         LoadComment(user.day);
     }
 }
Пример #6
0
        async void LoadPost(string id)
        {
            string response = await HttpGet.HttpGets(Config.apiDreamingOne + id);

            if (response != null)
            {
                try
                {
                    DataContractJsonSerializer ds = new DataContractJsonSerializer(typeof(DreamingModel));
                    MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(response));
                    dreaming             = ds.ReadObject(ms) as DreamingModel;
                    postGrid.DataContext = dreaming;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message.ToString());
                }
            }
        }