Robert inside the constructor of StringElement(), item.Key and se.Caption are exactly the same value.
I'm still no 100% this is by design, unless you were joking. D. On Sat, 05 Nov 2011 01:01:33, Robert Jordan <[email protected]> wrote: > 04.11.2011 23:48, Dominique Louis wrote: >> foreach (KeyValuePair<string, int> item in murderStats) >> { >> var se = new StringElement(item.Key, >> item.Value.ToString()); >> se.Tapped += delegate { >> StatisticsDrillDownMap( se ); // This works... >> StatisticsDrillDownMap( se.Caption ); // This does >> NOT work, and only holds the last item.Key >> }; >> sec.Add(se); >> } > Could it be that you wanted to write that > > StatisticsDrillDownMap(item.Key) > > doesn't work? Indeed, this is by design. > > Robert _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
