コード例 #1
0
 private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     GeoData.GeoCountryInfo selectedCountry = (GeoData.GeoCountryInfo)listBox1.SelectedItem;
     ((App)App.Current).tempChartData.CountryCode = selectedCountry.countryCode;
     ((App)App.Current).tempChartData.CountryName = selectedCountry.countryName;
     NavigationService.GoBack();
 }
コード例 #2
0
        public CountrySelector()
        {
            InitializeComponent();
            IList <GeoData.GeoCountryInfo> ctrs = GeoData.loadCountryInfo();

            GeoData.GeoCountryInfo custom = new GeoData.GeoCountryInfo();
            custom.countryName = "[CUSTOM LOCATION]";
            custom.countryCode = "CUSTOM";

            ctrs.Insert(0, custom);

            listBox1.ItemTemplate = countryTemplate;
            listBox1.ItemsSource  = ctrs;
        }