Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying a "Score Board" in windows phone
    text
    copied!<p>I am making an application for windows phone 8 that lets the user add fish types and angulars. They then pick which one they want to increment from a listpicker and can click and add or subtract button to increment its value. The types are stored in a Dictionary. I am trying to have a summary page that lists the fish and or angulars in descending order. Everything I have tried just shows repeated data. for example the fish type is walleye and the user clicks + 3 times it shows</p> <p>Walleye1</p> <p>Walleye2 </p> <p>Walleye3 </p> <p>Instead of just </p> <p>Walleye3</p> <p>Here is my code so far </p> <pre><code> Dictionary&lt;string, int&gt; FishListDic = new Dictionary&lt;string,int&gt;(); Dictionary&lt;string, int&gt; AngularListDic = new Dictionary&lt;string,int&gt;(); StringBuilder longlines = new StringBuilder(); private void FishAdd_Click(object sender, RoutedEventArgs e) { if (FishListDic.ContainsKey(FishName.Text)) { MessageBox.Show("Fish is already in the list"); } else { FishListDic.Add(FishName.Text, 0); Dictionary&lt;string, int&gt;.KeyCollection keyColl = FishListDic.Keys; FishList.Items.Clear(); foreach (string s in keyColl) { FishList.Items.Add(s); } } } private void FishIncrement_Click(object sender, RoutedEventArgs e) { string tempfishname; tempfishname = FishList.SelectedItem.ToString(); // FishListDic[tempfishname] = ; int temp = fishcount; if (!FishListDic.ContainsKey(FishList.SelectedItem.ToString())) { FishListDic.Add(FishList.SelectedItem.ToString(), 0); } FishListDic[FishList.SelectedItem.ToString()]++; foreach (KeyValuePair&lt;string, int&gt; kvp in FishListDic) { longlines.Append(kvp.Key.ToString() + kvp.Value.ToString() + '\n'); } Summary_Fish.Text = longlines.ToString(); } </code></pre> <p>Im pretty sure the problem is the stringbuilder append but i can't think of any other options at this point. I am trying to add it to a textblock on a pivot page as well. the above code only handles fish types so ill just duplicate for angulars</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload