public void SetSelected(Int32 index) { #if WINDOWS_PHONE if (index < 0 || index >= list.Count) { return; } ComboData cd = (ComboData)list[index]; Text = cd.ToString(); #else if (index < 0 || index > Items.Count) { return; } ComboData cd = (ComboData)Items[index]; #endif selectedData = cd; #if WINDOWS_PHONE if (OnSelectionChanged != null) { OnSelectionChanged(this, cd); } #else SelectedIndex = index; #endif }