Click here to Skip to main content
15,894,460 members
Articles / Programming Languages / C#

FloatingWindow - Multi-windows Interface for Silverlight 4

Rate me:
Please Sign up or sign in to vote.
4.92/5 (80 votes)
16 May 2011CPOL8 min read 508.2K   3.9K   123  
Resizable windows simulating multi-windows desktop interface for Silverlight 4
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Xml.Linq;
using SilverFlow.Controls;

namespace FloatingWindowControl
{
    /// <summary>
    /// Test class demonstrating a list of United States cities by population on July 1, 2009.
    /// Source: http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population
    /// </summary>
    public partial class Population : FloatingWindow
    {
        public Population()
        {
            InitializeComponent();
        }

        private void Population_Loaded(object sender, RoutedEventArgs e)
        {
            dataGrid.ItemsSource = GetPopulation();
        }

        private List<CityPopulation> GetPopulation()
        {
            var list = new List<CityPopulation>();
            XElement doc = XElement.Load(@"Population.xml");

            return (from el in doc.Elements()
                    select new CityPopulation
                    {
                        City = el.Element("City").Value,
                        State = el.Element("State").Value,
                        Population = el.Element("Population").Value
                    }
                   ).ToList();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Latvia Latvia
Jevgenij lives in Riga, Latvia. He started his programmer's career in 1983 developing software for radio equipment CAD systems. Created computer graphics for TV. Developed Internet credit card processing systems for banks.
Now he is System Analyst in Accenture.

Comments and Discussions