Ejemplo n.º 1
0
        void Cities_Loaded(object sender, RoutedEventArgs e)
        {
            Color fc = Color.FromArgb(0xff, 0xC0, 0x50, 0x4d);
            //maps.Foreground = new SolidColorBrush(fc);

            vl = new C1VectorLayer();

            Stream stream = typeof(Cities).GetTypeInfo().Assembly.GetManifestResourceStream("MapsSamples.Resources.Cities100K.txt");
            if (stream != null)
            {
                List<City> cities = City.Read(stream);
                vl.ItemTemplate = (DataTemplate)Resources["templCity"];
                IEnumerable<City> source = from city in cities orderby city.Population descending select city;
                vl.ItemsSource = source.Take(500);
            }
            stream.Dispose();
            stream = null;

            maps.Layers.Add(vl);
        }
        public Cities()
        {
            InitializeComponent();

            Color fc = Color.FromArgb(0xff, 0xC0, 0x50, 0x4d);

            maps.Foreground = new SolidColorBrush(fc);

            vl = new C1VectorLayer();

            Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MapsSamples.Resources.Cities100K.txt");

            if (stream != null)
            {
                List <City> cities = City.Read(stream);
                vl.ItemTemplate = (DataTemplate)Resources["templCity"];
                IEnumerable <City> source = from city in cities orderby city.Population descending select city;
                vl.ItemsSource = source.Take(500);
            }

            maps.Layers.Add(vl);
        }