Exemplo n.º 1
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            Post po = new Post
            {
                id     = 111,
                title  = "sdjkkjdsjksdjksdjkskj",
                userId = 2222,
                body   = "msjksdsjkskj Omar"
            };
            var str = PostServices.InsertPost(po);

            if (str != null)
            {
                List <Post> posts = list.ItemsSource as List <Post>;
                list.ItemsSource = null;
                list.ItemsSource = posts;
                posts.Insert(0, po);
                await DisplayAlert("", "لقد تمت الإضافة بنجاح ..عمر", "OK");
            }
        }
Exemplo n.º 2
0
 public void Create([FromBody] Post post)
 {
     _postServices.InsertPost(post);
 }
Exemplo n.º 3
0
 private void ADD(object sender, RoutedEventArgs e)
 {
     services.InsertPost(Text.Text);
     this.Close();
 }