Beispiel #1
0
        private void definePost(PostsResponse post, string cont)
        {
            postControl newPost = new postControl();

            newPost.post = post;
            byte[] img = Convert.FromBase64String(post.image);
            originalBitmap           = new WriteableBitmap(400, 360).FromByteArray(img, img.Length);
            newPost.imgPost.Source   = originalBitmap;
            newPost.description.Text = post.description;
            StackPanel conteudo = (StackPanel)this.FindName(cont);

            conteudo.Children.Add(newPost);
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                if (!e.Parameter.Equals(null))   // I've also used if(data != null) which hasn't worked either
                {
                    this.post = (PostsResponse)e.Parameter;
                    if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
                    {
                        App.addLoad(true, "Carregando");
                    }
                    var ok = await LoadPost();

                    if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
                    {
                        App.addLoad(false, "Carregando");
                    }
                }
            }
            catch { }
        }
Beispiel #3
0
 public async Task InserirPost(PostsResponse post)
 {
     await _conexao.InsertAsync(post);
 }