private void CheckBox_Toggled(object sender, RoutedEventArgs e) { foreach (Bird bird in BirdList.ItemsSource) { bird.IsCheckable = (bool)(sender as CheckBox).IsChecked; } // Have all the items raise a LayoutInvalidated event to make // sure any listening screen reader has a chance to flush any // cached data it might have on the item. BirdList.RaiseItemsLayoutInvalidatedEvent(); }
void LoadPlayerValues(string saveName) { XmlSerializer serializer = new XmlSerializer(typeof(BirdList)); string text = PlayerPrefs.GetString(saveName); if (text.Length == 0) { SetShop(); } else { using (var reader = new System.IO.StringReader(text)) { birds = serializer.Deserialize(reader) as BirdList; } } print("Loaded player values..."); }
static void Main(string[] args) { BirdList birdList = new BirdList(); string userInput = ""; while (userInput != "done") { Console.WriteLine("Please enter a bird:"); userInput = Console.ReadLine(); if (userInput == "done") { break; } birdList.AddToEnd(userInput); Console.WriteLine(birdList.getCount(userInput)); } birdList.getReport(); Console.ReadLine(); }