windows phone 7 - wp7 check for existing pivotitem in a pivot control -


I want to dynamically create a pivotment inside a spindle control, but before I do this, Want to see if a PivotTim has the same name value already? Is there any way to do this? If it is not already in existence, then I will make PivotTim as follows and make it in the chosen form.

  p = new PivotItem (); P. Name = name; P. Header = name; Pivot.Items.Add (P); Pivot Selected Iitem = p;   

I look at the pivot control items. (Object) method, but I'm not sure how I can pass an object that already exists or may be. Is it just a way to have a pivetem with a special name in the item collection?

You can use LINQ to ask the items collection Do:

  is included in bool = pivot .its .Casts & lt; PivotItem & gt; (). Any ((i) = & gt; i.Name == name); If (! In this!) {// Add new PivotTime. }    

Comments