Пример #1
0
 private void UpdateConcert()
 {
     var request = new HttpRequestGet();
     ValidateKey.CheckValidateKey();
     var news = request.GetSecureObject(new Concerts(), "concerts", TheConcert.id.ToString(),
         Singleton.Singleton.Instance().SecureKey, Singleton.Singleton.Instance().CurrentUser.id.ToString());
     news.ContinueWith(delegate(Task<object> tmp)
     {
         var test = tmp.Result as Concerts;
         if (test != null)
         {
             CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                 () =>
                 {
                     TheConcert.hasLiked = test.hasLiked;
                     TheConcert.likes = test.likes;
                     Likes = test.likes;
                 });
         }
     });
 }
Пример #2
0
 private void ItemClickCommandExecute()
 {
     var request = new HttpRequestGet();
     var album = request.GetSecureObject(new Album(), "albums", TheAlbum.id.ToString(),
         Singleton.Singleton.Instance().SecureKey, Singleton.Singleton.Instance().CurrentUser.id.ToString());
     album.ContinueWith(delegate(Task<object> tmp)
     {
         var test = tmp.Result as Album;
         if (test != null)
         {
             CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
             {
                 TheAlbum = test;
                 TheAlbum.imageAlbum =
                     new BitmapImage(new Uri(Constant.UrlImageAlbum + TheAlbum.image, UriKind.RelativeOrAbsolute));
                 AlbumViewModel.MyAlbum = TheAlbum;
                 GlobalMenuControl.SetChildren(new AlbumView());
             });
         }
     });
 }
Пример #3
0
        private void UpdateAlbum()
        {
            var request = new HttpRequestGet();
            var album = request.GetSecureObject(new Album(), "albums", TheAlbum.id.ToString(),
                Singleton.Singleton.Instance().SecureKey, Singleton.Singleton.Instance().CurrentUser.id.ToString());
            album.ContinueWith(delegate(Task<object> tmp)
            {
                var test = tmp.Result as Album;
                if (test != null)
                {
                    CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                        () =>
                        {
                            TheAlbum.hasLiked = test.hasLiked;
                            TheAlbum.likes = test.likes;
                            Likes = TheAlbum.likes;
                        });
                }
            });

            TheAlbum.image = Constant.UrlImageAlbum + TheAlbum.image;
        }
Пример #4
0
 private void AlbumStackPanel_OnTapped(object sender, TappedRoutedEventArgs e)
 {
     AlbumViewModel.MyAlbum = SelectedAlbum;
     var get = new HttpRequestGet();
     ValidateKey.GetValideKey();
     var res = get.GetSecureObject(new Album(), "albums", SelectedAlbum.id.ToString(),
         Singleton.Singleton.Instance().SecureKey, Singleton.Singleton.Instance().CurrentUser.id.ToString());
     res.ContinueWith(delegate(Task<object> tmp)
     {
         var album = tmp.Result as Album;
         if (album != null)
         {
             CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                 () =>
                 {
                     album.imageAlbum =
                         new BitmapImage(new Uri(Constant.UrlImageAlbum + album.image, UriKind.RelativeOrAbsolute));
                     AlbumViewModel.MyAlbum = album;
                     SetChildren(new AlbumView());
                 });
         }
     });
 }
Пример #5
0
 private void SelectionExecute()
 {
     ListMusics = new ObservableCollection<Music>();
     TheAlbum = MyAlbum;
     var req = new HttpRequestGet();
     ValidateKey.CheckValidateKey();
     var al = req.GetSecureObject(new Album(), "albums", TheAlbum.id.ToString(),
         Singleton.Singleton.Instance().SecureKey, Singleton.Singleton.Instance().CurrentUser.id.ToString());
     al.ContinueWith(delegate(Task<object> task)
     {
         var res = al.Result as Album;
         if (res != null)
        {
             CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                 () =>
                 {
                     ListMusics = res.musics;
                     Likes = res.likes;
                     Like = res.hasLiked ? bmLike : bmDislike;
                 });
         }
     });
     //TheAlbum.imageAlbum = new BitmapImage(new System.Uri(Constant.UrlImageAlbum + TheAlbum.image, UriKind.RelativeOrAbsolute));
     LoadComment();
 }