title: updating a selected row in listview for xaml
body: <p>I have a button in a listview and when i click the button the datatemplate should add 1 to the value. i just want specific rows to be updated but when i click the button, all of the rows are updated. Can someone help me? tried many solutions but it simply cant work.These are my xaml codes</p>
  
  <pre><code>&lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel Orientation="Horizontal" Width="1048" Height="158"&gt;
                  &lt;StackPanel.Background&gt;
                      &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                          &lt;GradientStop Color="White" Offset="0.971"/&gt;
                          &lt;GradientStop Color="#FF929990" Offset="1"/&gt;
                      &lt;/LinearGradientBrush&gt;
                  &lt;/StackPanel.Background&gt;&lt;Button x:Name="btnVote" BorderBrush="Black" BorderThickness="2" Height="45" Margin="0,70,0,43" Width="78" Content="Vote" Background="Black" Click="btnVote_Click" /&gt;
                  &lt;Image HorizontalAlignment="Left" Height="111" Margin="10,10,0,0" Grid.Row="1" VerticalAlignment="Top" Width="118" Source="{Binding Img}"/&gt;
                  &lt;HyperlinkButton Tag="{Binding UserID}" FontSize="20" ScrollViewer.VerticalScrollBarVisibility="Visible" Content="{Binding Name}" Width="918" Height="48" Margin="0,12,0,98" Foreground="Black" Tapped="HyperlinkButton_Tapped_1" HorizontalContentAlignment="Left"/&gt;
                  &lt;TextBlock FontSize="18" ScrollViewer.VerticalScrollBarVisibility="Visible" Text="{Binding Comment}" Width="884" Height="56" Margin="-930,59,0,43" Foreground="Black"/&gt;
                  &lt;TextBlock ScrollViewer.VerticalScrollBarVisibility="Visible" Text="{Binding DateTime}" Width="583" Height="36" Margin="-1230, 90, 0,0" Foreground="Black"/&gt;
                  &lt;TextBlock  ScrollViewer.VerticalScrollBarVisibility="Visible" Text="{Binding Votes}"  Margin="-500,100,0,10" Width="321" Height="48" Foreground="Black"/&gt;
              &lt;/StackPanel&gt;
  
          &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
      &lt;TextBlock Height="81" TextWrapping="Wrap" Text="TextBlock" Width="273"/&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>my xaml.cs codes for my button</p>
  
  <pre><code>private async void btnVote_Click(object sender, RoutedEventArgs e)
  {
      MyLearningStory.Clear(); 
      addVotes();
      retrieveLearningStory();
  
  
      //Service1Client updateclient = new Service1Client();
      //string update = await updateclient.updateVotesAsync(userId);
  
  }
  </code></pre>
  
  <p>and the method for getlearningstory()</p>
  
  <pre><code>public async void retrieveLearningStory()
  {
      btnShowMore.IsEnabled = true;
      Service1Client retrieveClient = new Service1Client();
  
      if (firstRun == true)
      {
          if(userId!=""){/*
              learningStoryComment.AddRange(await retrieveClient.retrieveLearingStoryCommentAsync(userId, storyId));
              learningStoryDatetime.AddRange(await retrieveClient.retrieveLearingStoryDatetimeAsync(userId, storyId));
              learningStoryImg.AddRange(await retrieveClient.retrieveLearingStoryImgAsync(userId, storyId));
                          */
              learningStoryComment.AddRange(await retrieveClient.retrieveLearingStoryCommentByStoryIDAsync(storyId));
              learningStoryDatetime.AddRange(await retrieveClient.retrieveLearingStoryDateTimeByStoryIDAsync(storyId));
              learningStoryImg.AddRange(await retrieveClient.retrieveLearingStoryImgByStoryIDAsync(storyId));
              learningStoryUserId.AddRange(await retrieveClient.retrieveLearingStoryUserIDByStoryIDAsync(storyId));
  
  
              }
      }
  
      await Task.Delay(1000);
  
      string name = "";
      Service1Client client1 = new Service1Client();
  
  
      if(userId==null){
          userId = roamingSettings.Values["userID"].ToString();
  
      }
  
      if (firstRun == true)
      {
          initialValue = 0;
          firstRun = false;
          currentUserId = userId;
  
      }
      //finding the  author of the learningstory
      for (int a = initialValue; a &lt; learningStoryComment.Count; a++)
      {
  
          if (a == (learningStoryComment.Count-1))
          {
              InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
              DataWriter writer = new DataWriter(randomAccessStream.GetOutputStreamAt(0));
              writer.WriteBytes(learningStoryImg[a]);
              await writer.StoreAsync();
              // Create bitmap image
              BitmapImage b = new BitmapImage();
              b.SetSource(randomAccessStream);
  
              name = await retrieveClient.retrieveNameByUserIDAsync(learningStoryUserId[0]);
             // status = await retrieveClient.RetrieveUserStatusAsync(learningStoryUserId[0]);
  
              imgFirstPost.Source = b;
              txtFirstPostComment.Text = learningStoryComment[a];
              txtFirstPostDateTime.Text = learningStoryDatetime[a].ToString();
              hbtnName.Content = name;
              hbtnName.Tag = currentUserId;
  
          }
  
  
      }
  
      //finding the other user that posted in the learningstory
      // for (int a = learningStoryComment.Count - 1; a &gt; -1; a--)
  
      //tbvotesdisplay = count.ToString();
      for (int a = initialValue; a &lt; learningStoryComment.Count; a++)
      {
          count++;
          InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
          DataWriter writer = new DataWriter(randomAccessStream.GetOutputStreamAt(0));
          writer.WriteBytes(learningStoryImg[a]);
          await writer.StoreAsync();
          // Create bitmap image
          BitmapImage b = new BitmapImage();
          b.SetSource(randomAccessStream);
          name = await client1.retrieveNameByUserIDAsync(learningStoryUserId[a]);
          //vote = await client1.retrieveVotesAsync(learningStoryUserId[a]);
          //status = await retrieveClient.RetrieveUserStatusAsync(learningStoryUserId[a]);
  
          if (a != (learningStoryComment.Count - 1))
          {
                 MyLearningStory.Add(new LearningStoryItem(learningStoryComment[a], name, learningStoryDatetime[a], b, 1, userId, votescount));
  
  
  
          }
     lvLearningStory.DataContext = MyLearningStory;
  </code></pre>
  
  <p>My add vote method</p>
  
  <pre><code>  public async void addVotes()
      {
          votescount++;
      }
  </code></pre>
  
  <p>my listview.datacontext class</p>
  
  <pre><code> public class LearningStoryItem
  {
        public BitmapImage Img { get; set; }
      public string Comment{ get; set; }
     public DateTime DateTime { get; set; }
     public string Name {get; set;}
     public int StoryID { get; set; }
     public string UserID { get; set; }
     public string LastCommented { get; set; }
     public string View { get; set; }
     public double Votes { get; set; }
  
     public LearningStoryItem(double votes)
     {
         Votes = votes;
     }
  
      public LearningStoryItem(string comment, DateTime datetime, BitmapImage img)
      {
          Comment = comment;
          DateTime = datetime;
          Img = img;
          Votes = 200;
      }
      public LearningStoryItem(string comment)
      {
          Comment = comment;
      }
      public LearningStoryItem(int storyid)
      {
         StoryID = storyid;
  
  
      }
  
      public LearningStoryItem(string comment, string name, DateTime datetime, BitmapImage img)
      {
          Comment = comment;
          DateTime = datetime;
          Img = img;
          Name = name;
  
          Votes = 200;
      }
      public LearningStoryItem(string comment, string name, DateTime datetime, BitmapImage img, int storyid)
      {
          Comment = comment;
          DateTime = datetime;
          Img = img;
          Name = name;
          StoryID = storyid;
  
          Votes = 200;
      }
      public LearningStoryItem(string comment, string name, DateTime datetime, BitmapImage img, int storyid, string userid,double votes)
      {
          Comment = comment;
          DateTime = datetime;
          Img = img;
          Name = name;
          StoryID = storyid;
          UserID = userid;
  
          Votes = votes;
  
      }
      public LearningStoryItem(string comment, string name, DateTime datetime, BitmapImage img, int storyid, string userid,string lastCommented)
      {
          Comment = comment;
          DateTime = datetime;
          Img = img;
          Name = name;
          StoryID = storyid;
          UserID = userid;
          LastCommented = lastCommented;
  
          Votes = 200;
      }
      public LearningStoryItem(string comment, string name, DateTime datetime, BitmapImage img, int storyid, string userid, string lastCommented,string view)
      {
          Comment = comment;
          DateTime = datetime;
          Img = img;
          Name = name;
          StoryID = storyid;
          UserID = userid;
          LastCommented = lastCommented;
          View = view;
  
          Votes = 200;
      }
  
      public LearningStoryItem(DateTime datetime)
      {
          DateTime = datetime;
  
          Votes = 200;
      }
      public LearningStoryItem(BitmapImage img)
      {
          Img = img;
  
          Votes = 200;
      }
      public LearningStoryItem(int storyid,string userid)
      {
          StoryID = storyid;
          UserID = userid;
  
          Votes = 200;
      }
  
  }
  </code></pre>
  
  <p>}</p>